If you are filing as head of household with one child, with a W-2 for $40,000, and have no other income or deductions, you would not have a balance due on a federal tax return.
Tax credits such as earned income credit and child tax credit, offset income tax liability and produce this result.
Any federal and state withholding listed on W-2 boxes 2 and 17, respectively, would increase your tax refund by those amounts.
Depending on your state, the state refund will differ.