I need to connect an -OH group to another molecule in one or two steps without harsh reaction conditions, easiest way seems like making an ester. But I think esters get hydrolyzed easily. Are there any other possible reactions.
You want to join a molecule containing an -OH group to another molecule by reacting the -OH group somehow?
Well, you can make an ester but it can be hydrolyzed - usually you would need mild acid and heating it to hydrolyze though. Water alone won't usually hydrolyze an ester.
Another option would be formation of an ether which are generally more stable than esters:
Another option would be formation of a tosylate which can act as a leaving group in various coupling reactions such as the Suzuki reaction whichwould give you a stable carbon-carbon bond. Tosylate can also act as a leaving group in various other reactions.
How is the reactant molecule functionalized? Adding a hydroxyl group to unactivated carbons is not straightforward. There are many different hydroxylating agents, and unless the structure of the starting molecule is known, it is hard to recommend a particular process.
If you have an -OH group on your molecule and you want that oxygen to form part of a C-O-C bond, you can esterify, but as noted above, hydrolysis can occur. The Williamson ether synthesis could be used to prepare simple alkyl ethers. If you do not care about retaining the original oxygen atom in the product, making it a better leaving group can permit substitution.