Cook the spaghetti according to package instructions until al dente.
While the pasta is cooking, heat olive oil in a large skillet over medium heat.
Add chopped onions and cook until translucent, about 5 minutes.
Stir in the minced garlic and diced bell pepper, cooking for another 3 minutes.
Add the diced chicken and cook until browned and cooked through, about 7-10 minutes.
Pour in the tomatoes and stir in the Italian herbs, salt, and pepper, simmering for 10 minutes.
Combine the cooked pasta and sauce in the skillet, mixing well to coat the spaghetti.
Toss in the shredded cheese, if using, and let it melt before serving.