Toast the guajillo chiles on a griddle until fragrant, being careful not to burn them.
Remove the stems and seeds from the chiles.
Add 4 cups of water, the guajillo chiles, onion, and garlic to a stock pot.
Bring to a boil and cook for 5 minutes. Turn off the heat and let cool slightly.
Drain and discard the cooking water.
Add the rehydrated chiles, onion, garlic, salt, and 2 cups of fresh water to a blender.
Blend until smooth. Strain the sauce for a smoother texture.
Heat the olive oil in a large skillet.
Slowly and carefully add the guajillo sauce. Stand back because the sauce may splatter.
Stir occasionally and cook for 5 minutes.
Crack each egg into a small bowl, then gently slide it into the simmering sauce.
Repeat with the remaining eggs.
Cover and reduce the heat to medium-low.
Simmer gently until the egg whites are fully cooked and the yolks are cooked to your liking.
Carefully scoop the eggs onto plates and spoon additional guajillo sauce over the top.
Serve with refried beans, avocado slices, and warm tortillas.