Cook the pasta: Boil the elbow macaroni in salted water until al dente, according to the package directions, then drain.
Brown the beef: Brown the ground beef and onion in a large oven-safe skillet or pot over medium heat, about 7-8 minutes, breaking up the meat as it cooks. Drain off the excess grease.
Build the sauce: Stir the tomato sauce, ketchup, mustard, brown sugar, salt, and pepper into the beef. Simmer 5 minutes so the flavors come together.
Combine: Preheat the oven to 350°F. Stir the cooked macaroni and half the cheddar into the beef mixture, then transfer to a greased 9x13 baking dish if not using an oven-safe skillet.
Bake: Top with the remaining cheddar and bake 15-20 minutes, until the cheese is melted and bubbly.
Serve: Let rest 5 minutes before serving.
Notes
Cook the pasta just to al dente since it softens more in the oven. Drain the beef well so the casserole isn't greasy.