Here's a fool-proof, reliable way to hard boil eggs.
Step 1

Place the eggs gently in an empty pot. If you accidentally crack an egg, adding salt or vinegar to the water may help the proteins in the egg white coagulate faster to plug the cracks in the shell.
Step 2

Fill the pot with enough cold tap water to completely cover the eggs, with about 1 inch (3 cm) of water over them. Using cold water helps keep the eggs from overcooking, even though it increases cooking times.
Step 3

Add enough salt to make the water taste salty. This can make the eggs easier to peel because, as mentioned earlier, the proteins coagulate and firm up, making the white easier to separate from the shell. Also, eggs that are less fresh are easier to peel because their higher pH strengthens the membrane. (This can be simulated by making the cooking water more alkaline with a half teaspoon of baking soda per quart of water.)
Step 4

Put on a lid. Bring the water to the point of boiling, over high heat. From here, there are two main schools of thought regarding how to get a perfectly hard boiled egg. The following method assumes you started with cold, refrigerated eggs. See the video below for the other method.
As soon as the water boils, turn off the heat, but keep the pot on the warm stove. Do not remove the lid. Leave the eggs in the hot water for ten to fifteen minutes. It is important you do not start the timer until the water starts boiling, and you turn off the heat. Too much time will make the eggs discolored and smelly, while too little time will cause them to be runny.
Step 5

Stop the cooking process. Chill the eggs by placing them under cold running water or in a bowl of ice water. Let them sit for a few minutes until the eggs are completely cool.
Step 6

Peel the eggs when they are cool enough to handle. It's easier to peel them under cold running water. Some people say that really fresh eggs are harder to peel, so try boiling eggs that you have had for a few days.
Step 7

Eat and enjoy!