I have a friend who is going to lend me 150,000 without interest or anything in return, so that I can pay off my loan. After that, I am going to take a loan from the bank and pay him back the money that he lent me. What is the Islamic ruling on that?
There is nothing wrong with the form of lending mentioned in the question. It is permissible for a person to pay off a loan that he owes to a particular person or institution with another loan that he takes from another source. This is not regarded as the type of secondary loan that is forbidden, in which the financer or lender of the second loan is the same as the one to whom the first loan is owed. This has been discussed previously in the answer to question no. 149437; q.v. for further information.
After that there is nothing wrong with you taking a new loan from the bank to make use of it or to pay off the debts that you owe, so long as the conditions of the loan are in accordance with Islamic teachings and are permissible.
And Allah knows best.