A habeas corpus petition is used to argue that a person is being unlawfully held in custody, and should be released. The following steps should be followed when filing a Petition for Writ of Habeas Corpus. 1.Go to Civil on the blue bar located at the top of the screen. Plaintiff: Use this form to obtain the presence of a witness in a civil or criminal case. I certify that this Writ was received and served as follows. Petition for Writ of Habeas Corpus. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. Generally, anyone detained or imprisoned can file a petition for a writ of habeas corpus in the United States. The privilege of the writ of habeas corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it.