President Trump’s first term was marked by significant defeats — and some wins — at the highest court in the country.