In 3-5 sentences, evaluate the goals and challenges of U.S. involvement in wars in Afghanistan and Iraq.

The goals of U.S. involvement in wars in Afghanistan and Iraq were primarily to combat terrorism, remove dictatorial regimes, and establish stable and democratic governments. These goals were aimed at promoting national security and protecting American interests. However, the challenges faced included a complex insurgent environment, ethnic and religious divisions, and the difficulty of nation-building in politically fragmented regions. Additionally, the prolonged nature of these conflicts, as well as the high financial and human costs, posed significant challenges to achieving the desired outcomes.