Preheat your oven to 350°F (175°C).
In a large pot, cook the elbow macaroni according to package instructions until al dente. Drain and set aside.
In a skillet over medium heat, brown the ground beef with chopped onion and minced garlic until the meat is cooked through. Drain any excess fat.
To the cooked beef mixture, add the tomato sauce, diced tomatoes, oregano, basil, salt, and pepper. Stir in the cooked macaroni and chopped bell pepper if using. Mix well until combined.
In a separate bowl, combine the sour cream and half of the shredded cheddar cheese. Stir the mixture into the beef and macaroni mixture until evenly distributed.
Transfer the mixture into a greased 9x13-inch baking dish. Sprinkle the remaining shredded cheddar cheese over the top.
Cover the dish with aluminum foil and bake in the preheated oven for 20 minutes.
Remove the foil and bake for an additional 10 minutes, or until the cheese is bubbly and golden.
Allow the casserole to cool for a few minutes before serving.