If the judge agrees with your challenge they can quash, or cancel, the decision (this is called “certiorari”). They can also order the agency or official to take particular action (called “mandamus”) – for example, ordering them to reconsider the issue and make a fresh decision.
It may be that no final decision has yet been made and you’ve gone to court in advance, to prevent it happening. In these cases the judge has the power to prohibit the agency or official from taking the decision or action you’re opposed to (“prohibition” or “injunction”).
The judge can also make an order declaring what your legal rights are in the situation (“declaration”).