How to synchronize a generator on the electrical grid?
I will preface this answer by saying that, at this time, I have no practical experience with power generation. The following comments are from stories I have listened to and documents I have read. You should not rely on any of this information while doing serious engineering work.

With that disclaimer out of the way...

The answer of "how do you synchronise a unit to another unit, or to the grid" depends on the size and type of the unit.

You didn't specify anything about the type or size of the units you are interested in synchronising. You also didn't mention what aspects you wanted explained (the hardware? the control algorithms? the regulatory requirements?) Therefore I will give a very general high level overview, with some other stuff thrown in for general interest.

The User Guide for the connection of generators of up
to 10 MW to the Western Power SWIN distribution
system  goes through some of the requirements for connecting small generators (up to 10 MW) to the (Australian) South West Interconnected Network. It doesn't talk so much about synchronising, but does talk about the protection and control schemes required.



Small units &lt; 1 MW

For small domestic or commercial type diesel generators, these are usually installed with a transfer switch. The transfer switch is interlocked to ensure the generator cannot parallel with the grid.

For solar inverters, which operate in parallel with the grid, these must be installed with loss-of-mains detection. This prevents the solar inverter from back-feeding power into a dead grid, which would endanger the people trying to fix the grid.



Medium units - 1 MW - 10 MW

Synchronising is done by an auto-synchroniser. This looks at the voltage and phase difference between the unit and the grid. It outputs control signals that vary the unit's speed, phase angle, and voltage until they are synchronised.

Speed and phase angle are varied by controlling the unit's throttle (a.k.a. 'governor', 'automatic generator controller'.) Voltage is adjusted by controlling the unit's automatic voltage regulator (AVR).

Separately, a synchronisation check relay (ANSI 25) is used. The sync check relay inhibits the unit from closing out of sync.

Closing out of sync causes severe electrical and mechanical stress and is to be avoided. The sync check function is therefore engineered to be a "high reliability" protection function with as few "moving parts" as possible.

Medium-size units connected to the grid are also usually equipped with some kind of anti-islanding protection. Again, this is to prevent back-energizing a dead grid. Common protection schemes for this are "rate of change of frequency", and "voltage vector shift".



Large units - power stations - 40 MW+

Large units at power stations have a synchroniser and synchronism-check relay, as above.

Additionally, their frequency may be deliberately adjusted to keep the grid frequency and phase in lock-step with a atomic clock reference.

Anti-islanding where the unit is cut off from the grid is not so much an issue, as the power station is the grid. The main concern is damage to the unit from load transients - either a sudden removal or addition of load. Overfrequency and underfrequency protection is one means of detecting these conditions. Additionally, fail-safe mechanical protections are used (i.e. mechanical overspeed, low/high boiler drum level.)



Finally - 


  I searched on YouTube for practical tutorials but I did not find useful information. Does anybody have?


You will not find instructions for setting up an auto-synchroniser or a sync-check relay on Youtube.

Such devices are supposed to be designed and installed by qualified electrical engineers, who do not generally look at Youtube videos for professional advice.

The information is far more likely to be found in the technical manuals for each part of the generator-set. I would guess that you would have to read the manuals for the generator, generator controller, automatic voltage regulator, synchroniser, and sync-check relay. After reading each of these documents, you would be in a position to understand the required equipment and configuration.