Alcohols can form hydrogen bonds with water and by breaking the hydrogen bonds already existing between water molecules. Therefore, they are soluble in water.
On die other hand, hydrocarbonds connot from hydrogen bonds with water and hence are incoluble in water.