The crushing weight of student debt and the Great Recession have shaped millennials' relationship with money, for better or worse. In some, it has created enough anxiety about financial security that they save as much as they can and avoid any type of credit agreement that could cause them to take on more debt. Others become so preoccupied with their present expenses that they fail to save for the future.

Unfortunately, both approaches have their drawbacks. Here are a few of the most common money mistakes millennials are making -- and what you can do to fix them.

Young man with money flying out of his wallet

Image source: Getty Images.

1. Not preparing for the unexpected

About 46% of millennials don't have any money set aside in an emergency fund, according to a 2017 survey by GOBankingRates. This can pose a problem when an unexpected event like a home repair, a costly medical bill, or a sudden job loss puts an extra strain on your budget. Without any savings to cover these financial emergencies, you may have no choice but to take on debt or fall behind on your rent or mortgage payment and other bills, which can have a serious impact on your creditworthiness.

Most experts recommend keeping at least three to six months' worth of expenses in a savings account to help cover unexpected expenses. Look at your monthly bills and calculate how much you would need to cover them. Then multiply that number by three (or six if you want to be extra safe) and create a weekly savings goal to help you reach it.

2. Avoiding credit

Only 1 in 3 millennials owns a credit card, according to a recent study by Bankrate. While it's wise not to overuse credit, avoiding it entirely can pose problems, especially when you go to buy a home or finance another big purchase.

Just about everyone will apply for a loan at some point in their lives. When you do, your lender will pull your credit reports to assess how responsible you've been with your money in the past. Your credit reports contain information on all active credit accounts in your name, but if you don't have any, you're not giving lenders anything to go on. This can make them hesitant to work with you, and they may deny your loan application or charge you a higher interest rate than someone with a well-established credit history. If you'd like to become a homeowner someday, then a nonexistent credit history will be a major obstacle.

You don't have to use credit cards, but it is important to build up your credit history in some way. Paying off student loans can help, and if you take out an auto loan or personal loan, these will appear on your credit report as well. But for many, credit cards are the ideal credit-building tool because you can use them regularly, and as long as you pay the balance in full each month, you won't have to pay any interest at all.

3. Not saving for retirement

For many millennials, paying off student loans is a much more pressing concern than saving for retirement. After all, they have 30 to 40 years left to work, so what's the big deal if they put off retirement savings for a few years?

The trouble is that your most valuable retirement contributions are the ones you make while you're young. The sooner you put funds in a retirement account, the more compound interest can make them grow. When you get a late start, your money has less time to gain interest before you need to start using it.

Say you put $10,000 in a retirement account when you're 25 years old. Assuming your investments earn 8% per year, that $10,000 will have grown to $253,000 by the time you're ready to retire at age 67. If you waited until age 35 to put that money in, it would only grow to $117,000. And if you waited until 45, you'd end up with only $54,000.

Waiting to start saving for retirement may not seem like a big deal, but it can mean a difference of hundreds of thousands of dollars. If you have any extra money left over after you've paid your bills each month, put it into your 401(k). If your employer doesn't offer one, then open an IRA.

4. Spending frivolously

Millennials are more likely to indulge their immediate wants than baby boomers and Gen X-ers are today. In a survey by Schwab, 60% of millennials admit to spending more than $4 on their coffee (though it doesn't specify how often), and they're more likely to eat out and spend money on clothing and electronics they don't need. While it's healthy to indulge these wants occasionally, doing it frequently can take a large chunk out of your budget, leaving you less money to put toward retirement and your emergency fund.

Take a good look at how much you're spending on the non-essentials each month and look for areas where you may be able to cut back. Making your coffee at home, rather than purchasing it at your favorite chain, will save you over $1,300 a year on average. This assumes that an average cup of Joe from a cafe is $4, while the cost of making a cup at home is $0.17, and you are drinking one cup per day. Dining in and curbing your shopping could free up even more money.

For millennials, it's all about maintaining a balance between what you need now and what you'll need later. By remaining mindful of how your present decisions are impacting your future finances, you'll be able to make smart choices that will serve you well today and in all of your tomorrows.