A writ of habeas corpus is a court order that tells some government official that they must produce a person who is being held in custody so that the court can determine whether that person is being held unjustly. In other words, it prevents people from being held indefinitely without being charged with a crime and tried for that crime. This is a very important protection of our rights as Americans. Therefore, it can rarely be suspended. According to the Cosntitution, the writ of habeas corpus can only be suspended unless there is a revolution in the country or there is an invasion. Section 9 of Article I says

the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it.