You have to do a sales and purchase agreement and the assignment deed as well to sell and transfer the 1/2 of the interest in the property to your friend. These have to be done in lawyer's office.
As you are going to mortgage the property after the transfer, you have to ask your friend to look for a bank willing to give a mortgage loan to him ( A ) after taking into account his repayment ability and security of the mortgage loan. A new mortgage loan in name of A and the bank will be made. The old mortgage loan is then discharged with settlement from the new mortgage loan..