Preheat your oven to 350°F (175°C).
In a large skillet over medium heat, cook the ground beef until browned. Drain any excess fat.
Add the diced onion and minced garlic to the skillet. Cook until the onion is translucent, about 3-4 minutes.
Stir in the taco seasoning, diced tomatoes, black beans, and corn. Cook for an additional 5 minutes until everything is heated through.
In a mixing bowl, combine the sour cream and salsa. Stir until well blended.
In the casserole dish, layer half of the crushed Doritos, followed by half of the beef mixture, half of the sour cream and salsa mixture, and half of the shredded cheese. Repeat the layers with the remaining ingredients.
Top the casserole with the remaining crushed Doritos and a sprinkle of cheese.
Bake in the preheated oven for 25-30 minutes until the cheese is melted and bubbly.
Remove from the oven and let it cool for a few minutes. Garnish with chopped green onions or olives, if desired.