As long as the sale price covers your outstanding mortgage and any loans on the property, this won’t be a problem.
All money is handled through your solicitor, who will ensure the outstanding mortgage and any other secured debts are repaid from the proceeds of the sale. Your solicitor will then transfer the remaining balance to your account.