This is called judicial review .
This ability of the federal courts to determine whether a law is constitutional or unconstitutional was established during the Supreme Court case Marbury vs. Madison (1803). This case paved the way for judicial review. To this day, this is one of the main functions of the US Supreme Court.