It happens to every single golfer at some point. Shots find a lake, creek, or ravine with the dreaded red or yellow stakes and lines. The only way that this can get worse is you if you compound one mistake with another. This is why it is so important to know all of your options on the course.
First of all check to see what color the stakes, or lines, are around the hazard. There are more options with red stakes than yellow. Remember that there does not have to be water for an area to be marked a hazard and if your ball is in a hazard you cannot ground your club prior to hitting the shot. If you take relief from a hazard it is always a one stroke penalty, but there are many different options and knowing them can save you strokes.
If the ball is in a hazard marked with yellow stakes you have several options. You can play the ball out of the hazard if possible, which should be considered but remember that in most cases it is best to drop the ball under a penalty of one stroke unless you have a high percentage shot out of the hazard. The next option would be to replay the shot from the spot from which it was originally hit. This does not sound like a great option but some times it is the best one. You may also drop the ball keeping the spot where the ball last crossed the hazard line in between you and the hole. You can go back as far as you want so it is best to find a nice even lie if there is a slope near the hazard. A shot that is ten yards longer from a flat lie is much better than a downhill lie closer to the green. Just remember that if the hazard line is yellow you have to keep the spot the ball last crossed between you the and the hole.
If the hazard line is red you have the options above plus two more. You can drop the ball, while incurring a one stroke penalty, within two club lengths of where the ball last crossed the hazard line but no closer to hole. You may also go to the other side of a hazard and drop the ball, must be the same distance to the hole.
Now that you know the options take the time to think it over before just throwing another ball down. Sometime there is such a thing as a good bogey.