Hydroplaning happens when a wedge of water lifts the tire off the road surface. Three things make it more likely: standing water, speed, and shallow tread that cannot channel water away.
Tread depth is the factor you control. A tire at 2/32 clears a small fraction of the water a new tire does, which is why many drivers replace at 4/32 rather than waiting for the legal limit.
If it happens, do not brake hard and do not jerk the wheel. Ease off the accelerator, keep the steering pointed straight, and wait for the tires to regain contact - it usually takes only a moment.
To reduce the risk: slow down in heavy rain, avoid standing water and ruts where it collects, keep pressures correct, and replace tires before the tread gets marginal.