Once you dive into the water, your character will start to swim.
While in swimming mode, you can dive deep into the water if you press the [C] key or lower the character's point of view.
When swimming under water, swimming speed increases and you do not get attacked by enemies.
One thing to note is that once you start swimming under water, an indicator will show how long you can hold your breath for. The indicator will start to turn red as you hold your breath and when it finally turns into full red, your HP will start to decrease.
Once you're out of the water, the breath indicator will fill up again.
In order to get out of dive mode, simply press the [space bar] or make your character to look upwards and swim.