As ever, if you keep your eggs in the fridge, then you should let them come to room temperature before cooking – if you start with a cold egg, then you're more likely to end up overcooking the yolk trying to get the white to set. Very fresh eggs are best for frying.
Heat olive oil in a cast iron skillet (or non-stick skillet) over medium heat. When the oil is hot, carefully add an egg to the skillet.
Immediately cover with a lid and let egg cook for 2 minutes. This helps speed up the process, which results in a perfectly cooked egg – a soft, but firm white, and a gorgeously soft & runny yolk.
Remove skillet from heat and serve immediately.
Notes
Use room temperature eggs. If your eggs are cold you can overcook the yolks.
Use fresh eggs. Check if your eggs are fresh by placing them in a bowl of water. Fresh eggs will sink to the bottom but eggs passed their prime will sink.
Use a mild flavored oil with a high smoking point. I like to use olive oil, but I would suspect that avocado and sunflower seed oil will both work well.