Preheat your oven to 375°F (190°C).
Cook the ziti pasta in a large pot of salted boiling water until al dente, then drain and set aside.
In a large skillet, warm the olive oil over medium heat and add the chopped onion, sautéing until soft and translucent, about 5 minutes.
Add the minced garlic and sauté for another minute.
Add the ground beef or sausage, breaking it apart as it cooks, and allow it to brown for 7-10 minutes, draining any excess fat.
Pour in the marinara sauce, followed by the oregano, basil, red pepper flakes, and season with salt and pepper. Let it simmer for about 5 minutes.
In a large bowl, combine the cooked ziti with the meat sauce, ricotta cheese, and half of the mozzarella. Stir until well mixed.
Pour the mixture into a greased 9x13 inch baking dish. Top with the remaining mozzarella and sprinkle Parmesan cheese over the top.
Cover with aluminum foil and bake for 20 minutes. Remove the foil and bake for another 10-15 minutes until the cheese is melted and golden brown.
Let it cool for about 5 minutes before serving. Garnish with fresh basil or parsley if desired.