Place the eggs in a small saucepan and cover them with cold water. Bring the water to a rolling boil over high heat, then reduce the heat to medium. Cook for about 10-12 minutes for hard-boiled eggs. Once done, drain the hot water and transfer the eggs to an ice bath to cool down quickly. This makes them easier to peel.
While the eggs are cooling, prepare your other ingredients. Peel and finely chop the red onion into small cubes. Halve the avocado, remove the pit, and scoop out the flesh.