Hm, this is a big subject. Want to share some basics because I get the question a lot. You will find lots of answers if you google and it is easy to get lost in technical details if you are new to the game. I will try to explain the basics. I also have two posts explaining how to photograph macro and wide angle under water.
Selecting a camera
There are no dedicated underwater cameras worth looking into. Nikon tried for a while with the Nikonos series but it is not available anymore. The thing everybody does is to put a decent dSLR into an underwater housing. So it all starts with this huge discussion about cameras and lenses. For each person this all boils down to what you can afford and are willing to spend. It really has no upper limit. I have always pursued resolution and ended up in the more pricy end, but over the years you get great quality images for less money. I would say as a rule of thumb that when you pass resolution 12-15 mp, your will not encounter too much problems resolution wise. Below this range you will struggle when printing larger images, but if this is not your plan, you can even go lower. In this modern age, images are mostly shared online and this is not demanding the same resolution.
For underwater work you can start with two different lenses. Choose one macro and one wide angle. You can read more about this under my sections about macro and wide. Selecting lenses with good quality usually follows the price and this is almost more important than to choose camera. If the camera is good and the lens bad – your image will become gray or struggle with focus etc. So put big part of the budget on good lenses.
Selecting underwater housing
No matter what camera you choose you will probably find several housings, from the less expensive plastic ones to large aluminum housings in the higher price range. If your diving is deep, wrecks and cave expeditions, under the ice etc., you will probably need a more expensive alu house. The depth range will be better and the rough environment will demand more from the equipment.
Photographing underwater requires lighting. Even in a few feet of water you start loosing color, so not doing strobes is not even an option. The new SLRs usually have video capability so you might want to select strobes that also have video lights in addition to being strobes. Having the ability to just switch to video is absolutely amazing.
Maintaining your equipment
This is the absolute most important thing. Take care of the equipment. I have in 25 years never ever drowned underwater cameras – and here is why. When you pack for travel you pack everything protected in cases. You absolutely always bring spare o-rings and plenty of grease. When you prepare for a dive you never ever compromise and take shortcuts to save time. You clean every part. Take out each o-ring. Clean every track with q-tips and visually inspect. You look for sand particles, grains of salt or even hair. If you dive deep, even a strand of hair over the o-ring can cause a leak. Then you do the same with each o-ring. Clean and gently apply a thin layer of grease. Wipe every connecting surface with a thin layer of grease. Put everything carefully together while visually inspecting. Close the housing tight. Clean the dome or flatports so no scrathes, hair or particles are left on the glass. When you enter the water, do not jump with the whole package. Let someone hand it to you when you are in the water. When you come under water you gently wipe the class for small bubbles.
When you shoot you have to be less careful. You have to get real close, jam your camera into places and be creative. Then after the dive you rinse all saltwater off, dry with towel and take it carefully apart.
Next dive you repeat.