Former short-order breakfast cook here; I’ll tell you the way I used to do it there, and still mostly do at home.
Take a 7 in. aluminum pan, like this one. Add a tablespoon of vegetable oil. Heat for about 15-30 seconds over low heat – on my gas stove at home, the right flame is just a little above the “low” setting on the dial. 30 seconds is for a cold pan, 15 is if the pan has been in use recently and is already warm. Swirl the oil in the pan, and then dump all of it out, leaving just what has coated the pan.
Place eggs in pan. You probably want to break them into a bowl first, but with practice, that’s really not necessary. You can then just wait until the whites are fully set and serve, but to most people’s taste, if you do so, either the yolks will be a little over, or the white will be undercooked, especially around and between the yolks.
Here’s the trick to deal with that: Eggs are not just white and yolk. When you put the eggs in the pan, you’ll notice that the whites are actually two distinct bits – there’s the white that spreads out evenly throughout the pan, but there’s also a sac of white that forms up next to yolk. When you first put the eggs in the pan, take an iced tea spoon an gently break that sac. Give it a gentle scramble to spread it. Then, once the whites start to set – around the time you could actually pour them onto a plate and have them still retain their shape, but while there is still uncooked white on top of a layer of cooked white – take that same spoon and gently scrape the uncooked white from between the two yolks. Don’t scrape all the way to the pan! Leave that cooked white there, and even a bit of the uncooked. The white between the yolks is always last to cook, and if you scrape some of it out of there, you’ll get a more even cook without overcooking the remainder of the eggs.
That’s the way we did it, but of course you can vary things. Oils other than vegetable are fine. Feel free to use Pam spray – it’s a pain in the ass to heat a tablespoon of oil just to dump it out as a home cook. In the restaurant, we just dumped it back in the oil container for use on the next order.
People who tell you to baste the eggs are just wrong. Doing so is fine, but then, obviously, you have basted eggs and not sunny side up eggs. Don’t cover the eggs while they cook – if you do, the small amount of white that invariably clings to the tops of the yolks will whiten, and you’ll have a nice edible egg, but it won’t have the pretty, entirely yellow yolk that is the hallmark of well cooked sunny side up eggs.
Finally, if you want the perfect sunny side up eggs that you see in menu pictures, cheat. Crack two eggs, separate the yolks and the whites. Cook the whites, plate, and then place the uncooked yolks on top.