My basic rule of thumb for loaning money to people is quite simple: I don't do it if I can't afford to not have the funds. That way, if they don't pay me back right away or at all, it's not like I am in dire straits without it.
Always take care of your own house before helping other people.
Also, keep a ledger of what people owe you (I am really good at remembering, so ledgers are pretty much unnecessary for me). At the very least, you will have a record of who NOT to loan money to in the future.