Leaving aside the possibility of your camera malfunctioning, there are 3 main reasons why you can get blurry pictures.
1. Not enough light: You camera needs light to focus, so if you are diving in the late afternoon or you are inside a wreck or visibility is simply not that great that day, there may not be enough light for your camera to focus. A focus light may solve that, but I've never used one and still get hundreds of correctly focused pictures.
2. The camera focuses on something closer: Sometimes when the water has a lot of particles, the camera ill focus on those instead of on your subject, producing a blurry picture. Just by looking at the picture in the computer you may see the lighted, properly focused particles called backscatter.
3. You are to close for your focus mode: Most if not all cameras these days have at least 2 focus modes normal (landscape) and macro. You use macro mode when you want to take close up pictures. This is where it gets tricky because "close" is different for every camera. Some cameras allow you to use macro mode from 1 inch to 2 feet. Same goes for the normal mode. If you are too close using the normal mode, then the camera will not focus. Look at your camera manual to find out how to engage the macro mode, the icon looks like this one:
Let us know the model and brand of your camera, so that we can help you further, and post some pictures if you can so that we can see what you are talking about.