Preheat the oven to 180°C (350°F).
Cook the pasta in salted boiling water until al dente; drain and set aside.
In a large skillet, heat olive oil over medium heat.
Add chopped onion and cook until translucent.
Stir in minced garlic and cook for another minute.
Add ground beef or sausage, cooking until browned.
Pour in crushed tomatoes, season with salt and pepper, and simmer for 15 minutes.
In a large baking dish, layer half the pasta, followed by half the meat sauce.
Sprinkle half of the mozzarella and Parmesan cheese on top.
Repeat the layers, finishing with cheese on top.
Bake in the preheated oven for 25-30 minutes until bubbly and golden.
Allow to cool for a few minutes before serving.