Sonar is typically used for that. Underwater sonar transducers are not cheap, be warned. For that
very short range perhaps there is a chance the water will be clear?
If so IR distance sensor would be a cheap option - not exact, but you haven't said how accurately
you want to measure distance.
With a sonar device, there is a chance that the transmitted pulse is too long and will overlap the echo. Check the spec data carefully before purchasing the device.
You also need to make sure the time between the bursts are long enough that you are not seeing something that is a multiple of the distance you are looking at as "too close" (if the echo from one pulse comes back just after you send a second pulse, your system will think it is "too close" ).
I think that sensor is meant to operate in air, not water. It's waterproof, not submersible. So even if it survives at your operating depth, it may not work for you, given the different speed of sound in air vs water (and impedance).