If you default on a federal student loan, your tax refunds can be taken to help cover what you owe. However, the government has paused this program and other collection activities through Sept. 30, 2021, due to the pandemic.
After that relief ends, the best way to stop student loans from taking your refund is to address the default before filing your tax return. Once your money is gone, it's much harder to get it back.