If you trust this friend, then of course you can lend him money, but if you see that he has problems with money and he is passionate about gambling, then you should think about whether he can return this debt to you. And if this is a reliable friend and he has some temporary difficulties with money, and he is not keen on gambling, then I believe that in this case you can borrow, and not worry about repaying the debt. Each situation is individual, and you need to take into account the circumstances under which a person needs money.
And in terms of whether he will be able to pay his debts or not, it actually depends on the situation he is experiencing, because not paying his debts is not always because he has bad habits, but a lack of income or a financial crisis situation could also be one of the causes, and I think It is a normal situation if they find it difficult to pay their debts to you, but if it turns out that they have bad habits such as gambling or other habits then yes that is another thing where you should not have lent them anything from the start.
And actually, for me, usually when one of my friends asks for help, such as wanting to borrow money, I usually don't think too much about when and whether he will be able to pay the debt or not, because usually money is something that is sensitive, especially in friendships. So from the start, when I give a loan to that person, I usually give up the money, meaning I don't really expect a return, but if at some point he pays it then that's good.