Take a large frying pan, and put several very generous glugs of oil in it. Start the oil heating over medium heat.
Peel and thinly slice the onion, and add to the heated oil. Lower the heat, and let the onions simmer in the oil for about 5 to 10 minutes until cooked, but don't let the onion brown. (Better to keep the heat lower and aim for a few more minutes gentle cooking time.)
When the onion looks like it's just about there in terms of being tender and golden, wash the potatoes, peel them, and slice them thinly. Turn up the heat a bit on the frying pan, put a bit more oil in, let it heat for a minute, then add the potato slices. Turn the slices frequently, and cook until soft and golden, but not browned.
Remove the onion and potato from the pan, and put on paper towel to drain.
Put about a tablespoon of good quality oil (olive oil, all things being equal) into a smaller frying pan (non-stick or well-seasoned cast iron is ideal), and start it heating over medium heat.
In a medium-sized bowl, beat the egg, then add the potato and onion, season with pepper (and salt, if desired), and then the mixture carefully to get the egg through it. Transfer the mixture to the heated frying pan. It will solidify as it cooks. After a few minutes, lift up the edges to check on the bottom. When it is browned, put a plate over top and do the flip to cook the other side.
Cook this newly-flipped side for a few minutes. When done, this side should be lightly browned, and the inside of the tortilla should still be a bit moist. Serve hot.