There are two major instances in the history of the United States when the right to habeas corpus has been suspended. These have come in the Civil War and in World War II. In the latter case, the suspension did not apply to all people.
The right to habeas corpus is the right to prevent the government from holding you for an indefinite time without charging you with a crime. In normal times, the government cannot detain you unless they charge you. If they do, you can go to a judge and require the government to charge you or release you.
In the two instances noted above, this right was suspended. In the Civil War, President Lincoln authorized the military to arrest and hold anyone they thought was dangerous. The Congress also authorized the holding of people for longer than usual time periods. In World War II, President Roosevelt issued an executive order interning people of Japanese descent living on the West Coast. These people did not have the right to show that their detention was illegal.
In both cases, the suspension came during a time of grave danger to the country.