While it may seem like you should have all debts wiped clear after you die, that is not actually what happens. You cannot get out of some debts that easily. NerdWallet explains that the government and creditors may go to your estate for money you owe to them after your death. This then becomes a matter that your estate and the probate court will handle.
The issue with owing debts after your death is that they can easily eat away at the money and assets you wish to leave to your heirs. It is a better idea to plan ahead and set aside funds to pay any debts. Another issue is that if you have a joint debt, then the other person will take over the responsibility for the debt alone. This includes any co-signers you may have had on a debt.
To properly plan, you need to know all your debts. Do not forget about taxes. Depending on the size of your estate, you may have to pay estate taxes. You also may have income and property taxes due after your death. Taxes take priority and the court will order your executor to pay them first before paying any other debts or your heirs.
If you leave an heir an asset that you secured with a loan, the loan does not usually become immediately due. You can plan to pay it off if you have the money to do so through your estate, but in most cases, the heir will simply take over the loan and make regular payments.