You do not necessarily have to inherit the debt, even if you don't know about it beforehand. Where I live that is called 'accepting an inheritance beneficially', it may have a different legal term where you live. The essence is that you only accept the inheritance if, and only if it brings you a net benefit and otherwise you reject it. Usually this costs a few units of your local currency to arrange.
Note that all this stuff can get very complex in a hurry especially when taxes are involved (and they usually are) so you should definitely hire the help of a professional when dealing with this for anything exceeding a few thousand.
Note that all this stuff can get very complex in a hurry especially when taxes are involved (and they usually are) so you should definitely hire the help of a professional when dealing with this for anything exceeding a few thousand.