If you just got an image that you want to add an underwater gradient to, then a blue gradient would probably work.
To use the mist pass you need a 3d scene. I just made a simple scene with a floor and 10 vertical cylinders at different distances from the camera.
The idea is to mix the rendered image with a blue color using the mist pass as a factor.
The mist pass is a depth pass, where the scene is mapped to 0.0 - 1.0 range (black to white) depending on the distance to the camera.
So objects close to the camera are black and objects further away are more white.
To use the mist pass, first you’ll have to enable it in the View Layer tab in the Properties editor:

Then, in the World tab, there are settings for the Start and Depth of the mist pass.
I.e. what distances that are mapped to black and white. Objects closer than Start value will be black and objects further away the camera than Start + Depth will be white.
Most of the time you’d set it to cover the range of your scene.
Then you make a render and set up the compositor as in my previous post.
