When you think ahead to retirement, you may look forward to relaxing days in some sunny location, perhaps near a beach or a golf course. You may think how nice it will be not to worry about getting to work on time. But for many people, being over 60 and in or near retirement hasn't saved them from a problem that often plagues younger people--student debt.

CBS News reports that 3 million Americans over the age of 60 still have student debt. And the Wall Street Journal reports that in 2017, their average debt was $33,800, up 44 percent from 2010. And more than 40,000 people over 65 are having their Social Security payments, tax refunds, or other government payments garnished because they aren't paying their student loans. That number has more than tripled in the last decade.

Graduating seniors at Morehouse College got a huge surprise on Sunday when billionaire commencement speaker Robert F. Smith announced he would pay off student loans for the entire graduating class of nearly 400. For everyone else, student debt is a national crisis with 44.7 million Americans--that's one out of every five of us--burdened by student loans. In all, we owe $1.6 trillion on these loans. Millennials find student debt disheartening--and many are holding off buying homes or starting families because of it. Still, most expect to be done paying by the time they reach retirement. Seniors facing $30,000 or more in student loans have fewer options.

People who are still struggling with student debt in their 60s got there one of three ways. In some cases, they have very longstanding loans which they've had trouble paying off over the years. CBS News interviewed 76-year-old Seraphina Galante, who says she has 19-year-old student debt. The payments have been reduced in accordance with her income. That sounds like a good thing, but her current lower payments aren't even enough to cover the interest on her loan which means that even as she keeps paying her monthly bill, the total she owes is going up instead of down. She says she'll die with that debt still unpaid. 

In other cases, seniors who at some time in midlife went back to school so as to broaden their skills or change careers took out loans for that further education and are now struggling to pay it back in their older years. But the majority of seniors with student debt took it on to help their children go to college. Lenders increasingly insist on having parents co-sign student loans. And loan amounts to students are capped while amounts to parents are not, which means some parents wind up taking on debt to fill in the gap.

How to avoid having student debt ruin your retirement years.

Many parents are willing to do almost anything for their children, up to and including putting their own retirement at risk. That makes sense, but financial advisors suggest thinking carefully, and realistically, about how much debt you can afford to take on for your children's education, and how to fit that debt into your life. This may mean sticking to a tighter budget, cutting back on dining out or taking more modest vacations. It could mean planning to take on a reverse mortgage, or extra work during your off hours to boost your income. Whichever the case, make sure you're up to it, and if you decide to co-sign a loan, make sure you're financially prepared to pay the entire loan if needed.

Financial advisors suggest borrowing no more than your annual salary, a sum you should be able to pay back within 10 years. If you plan to retire in less than 10 years, adjust the maximum downward accordingly. And if your income is below $45,000 a year, consider carefully whether you can afford to take on student debt at all.

Once you have the debt, don't default on it, if you can possibly help it. If you're having trouble making payments, find out if your loan is eligible for income-based repayments. You may be able to negotiate lower payments by extending the life of the loan or by consolidating debt. 

Whatever you do, make sure you know your rights. Some seniors report intimidating and unhelpful debt collectors for student loans. And don't hesitate to get legal help, especially if your Social Security or other government payments are being withheld. Some seniors, especially with lower incomes have been able to stop that from happening with legal representation.