Prep
Preheat oven to 375°F (190°C). Lightly grease a 9×13-inch baking dish.
Cook ziti in well-salted water until just al dente. Drain and set aside.
Sauce
Heat olive oil in a large skillet over medium heat.
Add onion and cook 2–3 minutes until soft.
Add garlic and cook 30 seconds until fragrant.
Add ground beef or sausage (if using) and cook until browned. Drain excess fat.
Stir in marinara sauce and Italian seasoning. Simmer 5 minutes.
Ricotta Mixture
In a bowl, mix ricotta, egg, salt, and pepper until smooth.
Assemble & Bake
Combine cooked pasta with most of the meat sauce.
Spread half of the pasta mixture into the baking dish.
Dollop and spread half of the ricotta mixture over pasta.
Sprinkle with mozzarella and Parmesan.
Repeat layers with remaining pasta, ricotta, and cheese.
Cover loosely with foil and bake 25 minutes.
Remove foil and bake 15–20 minutes more until bubbly and golden.
Finish
Rest 10 minutes before serving. Garnish with fresh parsley or basil if desired.