What is a “Writ of Habeas Corpus?”

The Supreme Court ruled that President Trump must give immigrants enough time to file a writ of habeas corpus before deporting them. WTF is that?