Like double and triple bonds, –OH groups change the reactivity of an alkane. So these are considered functional groups, called alcohols.
Alcohols are named as modifiers, meaning we add a suffix modifier to the root chain:
Alcohols receive highest priority (even more than double and triple bonds), so try to give them the smallest number possible. Remember: Alcohol beats all!
The biggest takeaway here is just to remember that having more than one location in front of your root name is always a mistake!
Place at least one of the locations within the root (or even all of them).
Example: Name the following compound:4m