Cook the egg noodles according to package directions. Drain and set aside.
In a saucepan, melt the butter over medium heat. Add the chopped onions and cook until they are soft and translucent.
In a large mixing bowl, combine the cooked noodles, mashed potatoes, shredded cheddar cheese, sour cream, cooked onions, salt, and black pepper. Mix well.
Transfer the mixture to a greased baking dish. Spread it out evenly.
Bake in the preheated oven for 30-40 minutes, or until the top is golden brown and the casserole is heated through.
Let it cool for a few minutes before serving. Enjoy!
Notes:
This casserole is a great way to use up leftover mashed potatoes.