Lending money to a family member or friend is a risky proposition, one that could end very badly. You could lose your money and wreck an important relationship.

Remember the advice Polonius gives his son, Laertes, in Shakespeare’s "Hamlet": “Neither a borrower nor a lender be, for loan oft loses both itself and friend.”

Nearly half (46 percent) of adults who lent money to friends or family reported having a negative outcome, 37 percent said they lost money and 21 percent experienced a damaged relationship with the borrower, according to a recent survey by Bankrate.com.

Cosigning a loan can also cause personal and financial problems. Again, nearly half (45 percent) the people in the Bankrate survey who did this said they experienced a negative consequence:

21 percent reported having their relationship damaged.

20 percent said their credit score was damaged as a direct result.

18 percent reported losing money in the process.

“This data clearly shows that we should not be lending money to family and friends and we should not be cosigning loans because, unfortunately, about half the time something goes wrong,” said Ted Rossman, industry analyst at Bankrate. “While it's bad enough to lose money, I think it’s worse when a relationship gets hurt, as it does all too often.”

Children often ask their parents to cosign a loan when they can’t get a credit card or car loan on their own. It’s easy to understand why a parent would want to help in this situation, but many don’t realize that consigning is a legal obligation that can come back to bite them.

“It’s a lot more than recommending someone for a loan; it’s a legal promise to repay the debt if the primary borrower does not,” Rossman explained. “Cosigners can lose money and their credit scores can be damaged if payments are not made on time.”

Cosigning can also affect the cosigner’s ability to obtain credit because it typically raises their person’s debt-to-income and credit utilization ratios. So, even if everything goes well, there can be consequences, Rossman told NBC News BETTER.

Lending money is a financial, not an emotional decision

A request to help a family member or close friend who’s in a bind can really tug at your heartstrings and make you do something you wouldn’t normally do.

If you expect to be repaid and you get stiffed, that sense of betrayal can create a lot of anger.

“It can ruin relationships,” said Bruce McClary, vice president of the National Foundation for Credit Counseling. “People often lend money on good faith and they don’t put things in writing. They don’t sit down and talk about the arrangement and what’s expected. Failing to set expectations and write it down always leads to regret.”

When he was a front-line credit counselor, McClary saw people dip into their retirement savings or borrow money themselves in order to lend to a family member in need.

“That just shows you how powerful the emotional element is and how it can make otherwise rational people do some crazy things with their money,” McClary said. “I’ve seen a lot of bad decisions that aren’t backed up by careful consideration.”

By putting the terms of the loan in writing, this becomes a financial transaction, eliminating the possibility that the borrower might consider this a gift. Just remember, there aren’t many consequences for not repaying you. It’s not going to hurt the borrower’s credit score, like defaulting on a bank loan would do. And chances are you’re not going to sue them.

Personal finance advisors contacted by NBC News BETTER have this advice: If you’re don’t feel comfortable lending that person money, don’t do it. If you agree to do it, consider it to be a gift that won’t be repaid. So, don’t lend more than you can afford to lose.

“Just assume that giving a friend or family member a loan is the equivalent of setting that money on fire,” said certified financial planner Megan Brinsfield, director of financial planning at Motley Fool Wealth Management. “Think of it that harshly, but at the same time, giving someone money and helping them out should bring joy to both parties, so it shouldn’t be done begrudgingly.”

Lending your credit card is also asking for trouble

The Bankrate survey also shows the potential pitfalls of lending your credit card to a friend or family member. Of those who did this, 37 percent had something bad happen:

21 percent lost money

16 percent said it harmed their relationship

12 percent took a hit to their credit score

Some cardholders don’t actually give their credit card away, they just love to jump in and pay a joint bill — maybe for lunch or the movies — in order to earn credit card rewards. It’s easy to assume the others will contribute their fair share, but don’t count on it.

Of the credit card holders who did this, expecting to be repaid, most (70 percent) said they did not get the money at least once (27 percent said it happened occasional and 23 percent said frequently).

Older millennials (age 30-38) were most likely to be stiffed when paying a group bill, the survey showed. They’re also the most likely to try the “pay the group bill to earn rewards” strategy.

“Even getting stiffed just once, will probably wipe out the value of the rewards you’ll earn and then some,” Bankrate’s Rossman said. “This is a risky strategy, particularly if it leads to credit card debt. If you're already in credit card debt, then you’re not only subsidizing your friend or family member's purchase, but you might be paying interest on it, too.”

More from BETTER

Want more tips like these? NBC News BETTER is obsessed with finding easier, healthier and smarter ways to live. Sign up for our newsletter and follow us on Facebook, Twitter and Instagram.