I took Widow's benefits from my ex-husband and I am trying to determine what income/expenses impact the cap before I go over the maximum amount which is about 18,000 for 2020. I took a new job which offered health insurance and took the HSA and was wondering if insurance premiums and contributions to the HSA are able to be deducted from my income in figuring out the MAGI.
Your MAGI, or modified adjusted gross income, is irrelevant when determining your countable earnings for purposes of Social Security's earnings test. Earned income, specifically gross wages and/or net earnings from self-employment, is the only type of income that counts toward the earnings test exempt amount. The exempt amount for people who are under full retirement age (FRA) throughout the year of 2020 is $18,240 (https://www.ssa.gov/planners/retire/whileworking.html). If they exceed that amount then $1 of their benefits must be withheld for every $2 of the excess.
Contributions to an HSA can't be used to reduce your countable earned income for purposes of Social Security's earnings test, but if you agreed to take a lower salary in return for having your employer pay your health insurance premiums then it's possible that might reduce your countable earned income. Basically, Social Security will count for earnings test purposes the amount shown as 'Social Security Wages' on your W-2 form, assuming that Social Security taxes are deducted from your wages.