The first thing you need to do is to know what's wrong with it. Is the lens broken? Is the sensor dirty? Is the camera software malfunctioning? The fix for your phone is not going to be the same as the fix for mine.
I've only had my phone for a couple of months and I've never dropped it, but recently when I go to take a photo, the viewfinder on the camera is black and the camera won't take the photo. I can hear the shutter clicking but nothing is being recorded. There are no cracks on the screen and the lens looks fine.