The figure of 500,000 includes those going bankrupt "somewhat" because of their medical bills or illness.
As the New York Times reports, "The study itself noted that health problems can cause bankruptcies in two ways, through direct medical bills and lost income due to illness itself. The 500,000 figure includes both groups."
The Washington Post also states, "Critics say the study [...] casts too wide a net because it counts anyone who mentioned medical bills or illness among their reasons for declaring bankruptcy, not just those who said it was the main reason or a big piece. Bankruptcies typically involve multiple causes, and in some cases, medical bills may be a small piece of the pie."
On Sanders' website, he is critical of the Washington Post's analysis, saying that the "530,000 figure is an underestimate of the number of people affected by medical bankruptcies. Most bankruptcies involve more than one person - an average of about 2.7 people, often including a spouse/partner and children."
The COVID-19 pandemic has given rise to a lot of potentially dangerous misinformation. For reliable advice on COVID-19 including symptoms, prevention and available treatment, please refer to the World Health Organisation or your national healthcare authority.