In some cases, the proceeds of the sale do not cover the remaining mortgage. If the amount is relatively small you could take out a personal loan or sell some of your assets.
If the amount is quite large a course of action would be to get professional advice from your accountant and/or financial adviser.