Debt as such cannot be inherited. However, the creditors have the right to claim their share from the estate before it is passed on to the heirs. If the value of the estate is greater than the debts, then the heirs get whatever is left over. If the debt is greater than the value, then the creditors get to fight over the scraps and the heirs get zip. (It’s more complicated than that, but that’s the gist of it.) That’s assuming it is a straightforward inheritance of an estate. There are more complex ways to structure an inheritance, with trusts and such, that would change the process. Your lawyers, tax advisers, etc., can fill you in on those.
For a secured debt such as a home mortgage, it isn’t a big deal because there is a known asset that can be sold to cover the most or all of the debt, and there are only one or two creditors involved. Where it gets messy is if there are lots of unsecured credit cards, etc. The executor has to sort out who is owed what. I had to do this for my mother’s estate, and the most annoying part wasn’t the amount of debt (she was pretty careful about that), but the number of different creditors. Older people tend to have lots of store credit cards and such, plus medical bills, car note, etc. There were at least 20 credit cards alone. I decided it was better to pay a lawyer to process most of it. It cost money to do that, but it was worth it to me.