Steps
1. Start by toasting the bread slices until golden brown.
2. In a pan, melt the butter over medium heat and sauté the chopped onions until they are soft and translucent.
3. In a bowl, whisk the egg with a pinch of salt and pepper.
4. Pour the egg into the pan with the onions, scrambling gently until the egg is cooked through.
5. Spread mayonnaise on one slice of toasted bread and ketchup on the other.
6. Layer the scrambled egg and onion mixture on the mayonnaise side, then top with the ketchup slice.
7. Cut the sandwich in half and serve warm.