Preheat oven to 375°F (190°C).
- Cook macaroni in salted water until al dente. Drain and set aside.
- In a large skillet, heat olive oil over medium heat. Add diced onion and sauté until soft, about 3–4 minutes. Add garlic and cook 1 more minute.
- Add ground beef and cook until browned. Drain excess fat.
- Stir in taco seasoning, diced tomatoes with green chilies, tomato sauce, black beans, and corn. Simmer for 5–7 minutes.
- Add cooked pasta and half of the shredded cheese to the skillet. Stir to combine.
- Transfer the mixture to a greased 9×13-inch baking dish and spread evenly.
- Top with remaining cheese.
- Bake uncovered for 20–25 minutes until cheese is melted and bubbly.
- Let rest for a few minutes before serving. Garnish with cilantro or green onions if desired.