The cell membrane is formed by a lipid bilayer of phospholipid.
Phospholipids are amphipathic, which means one region is hydrophobic and the other one is hydrophobic. Given this property, the phospholipids arrange themselves with the hydrophilic "heads" on the outside and the hydrophobic "tail" to the interior of the membrane, forming the bilayer and mantaining iitsshape.