Preheat oven to 350°F (175°C). Lightly grease a 9×13-inch baking dish.
- Cook spaghetti according to package directions until al dente. Drain and set aside.
- Heat butter or oil in a large skillet over medium heat. Sauté onion and garlic until softened.
- Stir in Rotel, cream of chicken soup, and cream cheese (if using) until smooth.
- Add shredded chicken and chicken broth to loosen the sauce. Season with salt, pepper, and jalapeños or red pepper flakes.
- Add cooked spaghetti to the skillet and toss until coated.
- Transfer mixture to the prepared baking dish. Sprinkle with cheddar cheese.
- Bake uncovered 25–30 minutes until bubbly and golden on top.
- Let rest 5–10 minutes before serving. Garnish with parsley or green onions.