That's from Shakespeare, in Hamlet. It's a man's advice to his son. He means, don't borrow from or lend to friends.
To borrow money to invest is a very bad idea.
What will you do if you lost money investing?
It's biblical advice and it's good advice. Your best bet is to develop a long and short term plan and stick to it.
Historically, it was considered immoral to charge interest on money.
Here is a decent article:
https://www.theobjectivestandard.com/iss...
Those are big "IFs"