Place the eggs in a single layer at the bottom of a saucepan. Cover with at least an inch or two of cold water. The more eggs that are crowding the pan the more water you should have over the eggs.
Heat the pot on high heat and bring the water to a full rolling boil. (Adding a teaspoon of vinegar to the water may help keep egg whites from running out if an egg does crack while cooking. Also some people find adding 1/2 teaspoon of salt to the water helps prevent cracking as well as making the eggs easier to peel.)
Turn off the heat, keep the pan on the hot burner, cover, and let sit for 10-12 minutes. (If you have the type of stove burner that doesn’t retain any heat when turned off, you might want to lower the temp to low, simmer for a minute, and then turn it off.)
Depending on how cooked you like your hard boiled eggs, the eggs should be done perfectly in 10-12 minutes. That said, depending on your altitude, the shape of the pan, the size of the eggs, the ratio of water to eggs, it can take a few minutes more. Or if you like your eggs not fully hard cooked, it can take a few minutes less. When you find a time that works for you, given your preferences, the types of eggs you buy, your pots, stove, and cooking environment, stick with it.
Strain the water from the pan and run cold water over the eggs to cool them quickly and stop them from cooking further. Or, if you are cooking a large batch of eggs, remove them with a slotted spoon to a large bowl of ice water.
I find it easiest to peel the eggs under a bit of running water.
The best way to store hard boiled eggs is in a covered container in the refrigerator. Eggs can release odors in the fridge which is why it helps to keep them covered. They should be eaten within 5 days.