First, preheat your oven to 375°F (190°C). Then, prepare all your ingredients by chopping and measuring so that everything is ready to go.
In a large skillet, heat olive oil over medium heat. Next, add the chopped onions and minced garlic, and sauté until they become soft and fragrant.
Now, add the ground beef to the skillet and cook until it is browned, stirring often to break up the meat. Next, sprinkle a blend of salt, pepper, thyme, and oregano over the beef to enhance its flavor.
Then, mix in the diced sweet potatoes, red bell pepper, and diced tomatoes. Allow the mixture to cook for about 5 minutes, so the flavors start to blend.
Next, pour in the beef broth and let the mixture simmer for another 10 minutes until the sweet potatoes begin to soften. If using, add the fresh spinach during the last couple of minutes until it wilts.
After that, transfer the entire mixture into a casserole dish. Cover it with foil and bake in the preheated oven for 25 minutes.
Finally, remove the foil, stir gently, and bake uncovered for an additional 10 minutes to let the top get a light, crispy finish. Then, let the casserole cool slightly before serving.