To begin, heat 2 tablespoons of vegetable oil in a medium skillet over medium heat. Add the finely chopped onions, garlic, and jalapeño. Sauté for about 3-4 minutes until softened and fragrant.
Add the diced tomatoes, ground cumin, salt, and black pepper to the skillet. Stir well and cook for 5-7 minutes, allowing the tomatoes to break down and create a rich sauce. If the mixture becomes too thick, add a splash of water to achieve the desired consistency.
Reduce the heat to low and let the ranchero sauce simmer gently for another 5 minutes. Taste and adjust seasoning if necessary. Once done, set aside the sauce while you prepare the other components.
In a separate skillet, heat another 2 tablespoons of vegetable oil over medium to high heat. Fry the corn tortillas one at a time, flipping them occasionally until they are crispy and golden, about 1-2 minutes per side. Remove and place on a paper towel to drain excess oil. Keep the tortillas warm.
If using refried beans, warm them in a small saucepan over low heat, stirring occasionally until heated through. You can also spread a thin layer of refried beans onto the tortillas later if desired for extra texture and flavour.
In the same skillet used to fry the tortillas, reduce the heat to medium and fry the eggs. Cook them sunny-side up or to your preferred doneness. If you prefer the yolks runny, reduce the cooking time accordingly.
To assemble, place two fried tortillas on each plate. If using refried beans, spread a spoonful over each tortilla. Top each tortilla with a fried egg, then generously spoon the ranchero sauce over the eggs.
Garnish with freshly chopped cilantro and shredded cheese (if using). Serve your Huevos Rancheros immediately, accompanied by extra tortillas, fresh salsa, or avocado slices for a complete, authentic Mexican breakfast.