Add the eggs to a large saucepan or pot. Make sure they are laid down in a single layer and not stacked on top of each other.
Gently add cold water (not ice water) to the pot until it completely covers the eggs. It should reach above their tops. If you are cooking fewer than 7 eggs, you can have the water reach 1 inch over their tops. If you are cooking 7 or more eggs, the water should cover at least 2 inches above the tops of the eggs.
Add some fine salt. This helps soften the eggshell, making it more pliable and less prone to crack when the water starts to boil. the salt simultaneously makes the egg shells easier to peel.
Now, add the pot with water, salt, and eggs over high heat. Do not add the lid. Bring the water to a rolling boil.
Once boiling, remove the pot from the heat, cover it with a tight-fitting lid, and leave the eggs to sit.
As per my guidelines above, for hard-boiled eggs, you can leave them to rest for 10 minutes in the hot water. Don't leave the eggs for too long or they will overcook (form a green ring around the yolk).
You can test the doneness of one egg before removing all of them. Personally, this is a foolproof method, but if you love to stay on the safe side of things, you can do one of the tests below.
When you are happy with the doneness of the boiled eggs, remove them from the hot water and plunge them into ice-filled water. This immediately stops the cooking process and prevents the eggs from overcooking. It's an essential step if you are making soft or medium-boiled eggs.