Preheat oven to 375°F (190°C).
- In a skillet, heat olive oil over medium heat. Add diced onion and sauté until soft, about 5 minutes. Add minced garlic and cook for 1 minute.
- Add ground beef or sausage (if using) and cook until browned. Drain excess fat.
- Stir in marinara sauce, Italian seasoning, salt, and pepper. Simmer for 5 minutes.
- Spread a thin layer of sauce on the bottom of a greased 9×13-inch baking dish.
- Add a layer of ravioli (no need to pre-cook). Spoon more sauce over the ravioli and sprinkle with mozzarella and Parmesan. Add dollops of ricotta if using.
- Repeat layers until all ingredients are used, ending with sauce and cheese on top.
- Cover with foil and bake for 30 minutes. Remove foil and bake for an additional 10–15 minutes, until bubbly and golden on top.
- Let rest for 5–10 minutes before serving. Garnish with chopped basil or parsley if desired.