There are a couple of old truisms about lending friends money.
“Don’t lend a friend money if you plan to keep either”
and
“Never lend a friend money you would miss if they never paid you back”
Now, there may be a way for you to set up something legally binding that would help protect you from the second one. But such an arrangement WILL put stress on the friendship. About the only person on the planet I would agree to such an arrangement for is my own mother; I’d consider it with my brother and sister, but would still be hesitant.