Medical bills can mount after a major illness or medical event. Sometimes medical emergencies occur and there is no choice whether or not expensive medical attention must be sought. Medical bills are unsecured debts. Unsecured debt is debt that a creditor would have to sue you before they took any of your property away from you, generally.
The IRS is also ordinarily an unsecured creditor. However, the IRS is typically not dischargeable because they are a priority unsecured creditor. Medical bills are not priority creditors. They are non-priority unsecured creditors much like credit cards.
Unsecured non-priority debts is usually dischargeable in a Chapter 7 or Chapter 13 bankruptcy.