Every person restrained of his or her liberty under any pretense whatever, may prosecute a writ of habeas corpus to inquire into the cause of the restraint. Use this if you have a court order giving you custody of your child and the other parent has taken your child away from you.It demands a person's release from unlawful detention. A 2254 petition must be filed in the federal district court that has jurisdiction over the county where the conviction occurred. Who Should Use This Form. You should use this form if. A writ of habeas corpus requires that a person who is in custody be brought before a judge or court and that they be able to challenge that custody. What Is the Main Essential in a Writ of Habeas Corpus? The Sheriff's Office serves and executes the Writ of Habeas Corpus and Warrant in Aid of Writ of Habeas Corpus. Federal criminal defense explains a federal Habeas Corpus petition, a legal remedy to protect against someone's unlawful and indefinite imprisonment.