A writ of habeas corpust safeguards individual freedom by allowing the accused to request trial by jury.
In the US system, federal courts can use the writ of habeas corpus in order to determine if a state's detention of a prisoner is valid. A writ of habeas corpus is implemented to bring a prisoner or other detainee (e.g. institutionalized mental patient) before the court to determine if the person's imprisonment or detention is lawful. A wrist of habeas corpus can also be used in order to examine any extradition processes used, the amount of bail, and the jurisdiction of the court.