01 - Preheat oven to 375°F. Grease a 9x13-inch baking dish.
02 - Bring a large pot of salted water to a boil. Cook ziti until just al dente, about 7–8 minutes. Drain and set aside.
03 - Heat olive oil in a large skillet over medium heat. Cook onion until softened, about 3–4 minutes, then add garlic and cook for 1 minute.
04 - Add ground beef to skillet, breaking it up with a spoon, and cook until browned with no pink remaining, about 7 minutes. Drain excess fat if needed.
05 - Stir in tomato paste, pasta sauce, oregano, basil, crushed red pepper flakes (if using), salt, and pepper. Simmer for 5 minutes to combine flavors.
06 - In a bowl, combine ricotta cheese with half of the Parmesan cheese and season with salt and pepper.
07 - Spread half of the cooked ziti in the baking dish. Layer half of the meat sauce, dollops of half the ricotta mixture, and half the mozzarella cheese.
08 - Repeat layering with remaining ziti, meat sauce, ricotta mixture, and finish with remaining mozzarella and Parmesan cheese.
09 - Cover with foil and bake for 25 minutes.
10 - Remove foil and bake an additional 10–15 minutes until cheese is bubbly and golden.
11 - Let rest for 10 minutes before serving. Garnish with fresh basil leaves if desired.