There are many ways and I've only covered a few things....
so how does clock get synchronized before data transmission?
In many cases the receiver doesn't acquire sync until it recognizes a frame header. And this means that some initial data is never recognized and is lost forever. However, for things like CCTVs and remote monitoring of signals this simply doesn't matter.
Once the receiver has "locked" to the frame then it can acquire data. This means that the receiver must know the data layout i.e. header followed by a byte representing the payload byte length followed by payload data and possibly appended with a CRC error check byte(s). That was just a typical example.
And it must recognize the next frame header or else it might consider discarding what it thought was the previous frame of data.
And, in many cases, the data has to be modulated in one form or another to ensure that there are sufficient bit changes so that the receiver can keep its automatically generated internal clock synchronized to the incoming data. This can be achieved by: -
Both of which are too deep to go into here.
Of course, the transmitter could just ship-out a clock signal on another wire for use by the receiver and that solves a lot of problems.