First you have to be able to hold your breathe and accept the fact that you can not breathe for a fe wseconds and be okay. Next blow out some bubbles so that you dont float to the top of the water, after that focus on the silence under the water and the slow mation weightless feel you get. After that just relax, it should come naturally.
What works for me is to focus on slowing my heart rate. Basically just trying to stay calm and relaxed. I don't try to think of anything, sort of like meditating. If your not a good swimmer, just practice in a shallow pool or the bath tub, where you know you are totally in control.