Many of us count on Social Security to provide financial support in retirement, but benefits aren't a given, even if you've paid into the program in the past. You must qualify for them and then you have to wait until you're old enough to claim them.

Though most people qualify for Social Security without any trouble, here are ways that you could render yourself ineligible for these benefits if you're not careful.

Social Security card

Image source: Getty Images.

1. Failing to work long enough

You must work long enough to earn at least 40 credits in order to qualify for Social Security. The definition of a credit varies by year. In 2020, you get one credit for every $1,410 you earn, and you can earn a maximum of four credits in a single year. In 2021, you can also earn up to four credits, but one credit is defined as $1,470 in earnings. That means you must work at least 10 years to be eligible for Social Security, though those 10 years do not have to be consecutive.

It's technically possible to get Social Security without ever working if you are or have been married to someone who did qualify for Social Security. Spousal benefits are available to current spouses of qualifying workers and ex-spouses who were married to a qualifying worker for at least 10 years and have been divorced for at least two years.

Spousal benefits are half of the qualifying worker's benefit at full retirement age. But if you have not earned your 40 credits, you cannot claim any benefits based on your own work record.

2. Failing to report your self-employment income

Workers with employers have Social Security taxes automatically withdrawn from each paycheck, but self-employed workers must set this money aside themselves and pay it into the government quarterly as estimated taxes. Your Social Security benefits are based on the amount of income you paid Social Security taxes on during your working years, so failing to report self-employment income won't help you earn your 40 credits. It could also get you audited and possibly jailed for tax evasion.

Self-employed workers must set aside 12.4% of their annual income for Social Security taxes, but you only pay this amount on at most $137,700 in 2020 and $142,800 in 2021. Any income over this amount is not subject to Social Security taxes and therefore will not increase your Social Security benefit in retirement. But you still have to pay income tax on it.

And if you do meet the two requirements above but don't live until 62, you won't be able to claim benefits on your own, though your surviving relatives may be able to claim Social Security based on your work record. How much they may get depends on their age, their relationship to you, and whether they are caring for a qualifying child of yours. Here is a more detailed guide if you're interested in learning how Social Security survivors benefits work.

If you've worked for at least 10 years, reported your income to the government, and make it to at least 62, you should be able to claim Social Security without an issue. You can create a my Social Security account to check how much income you've paid Social Security tax on over your working life and to see what you might be able to expect in terms of benefits when you're old enough to claim them.