President Joe Biden’s foreign policy legacy, including Afghanistan, Ukraine, and the Middle East, faces scrutiny as he prepares to leave office