Each case is different. Some agencies, like U.S. Citizenship & Immigration Services, will have an internal process available, like a motion to reopen or reconsider, or an appeal to an administrative appeals office to review a decision. Others, like U.S. Consulates abroad, or certain cases where the U.S. Customs & Border Protection turns someone with a visa away, have to be challenged either informally or sometimes by suing the agency in federal court.