01 - Preheat oven to 375°F. Grease a 9x13-inch baking dish.
02 - Cook ziti in a large pot of salted boiling water until al dente. Drain and set aside.
03 - Heat olive oil in a large skillet over medium heat. Add ground beef and cook until browned, breaking up with a spoon.
04 - Add chopped onion to the beef and cook for 3–4 minutes until softened. Stir in garlic and cook for 1 more minute.
05 - Stir in crushed tomatoes, tomato sauce, tomato paste, oregano, basil, red pepper flakes (if using), salt, black pepper, and sugar. Simmer for 10–15 minutes, stirring occasionally.
06 - In a bowl, mix ricotta cheese, egg, and half of the parmesan cheese until combined.
07 - Add cooked ziti to the skillet with meat sauce and toss to coat evenly.
08 - Place half of the sauced pasta in the prepared dish. Dot with half the ricotta mixture and sprinkle with half the mozzarella. Repeat layers. Finish with remaining parmesan cheese on top.
09 - Cover with foil and bake for 20 minutes. Remove foil and bake an additional 10–15 minutes until cheese is melted and golden.
10 - Allow to cool 10 minutes before serving. Garnish with fresh parsley or basil if desired.