How is the phase of a local oscillator synchronized to the carrier for demodulation?
Look for Costas Loop on Wikipedia

The general idea is that the carrier phase changes slowly, whereas the data changes quickly. This allows a slow loop to track the carrier phase.

Although the technique can be applied to the RF, and can be done with analogue processing, these days it is invariably done digitally, and at the complex baseband.