QuickBooks Desktop will adjust the payroll liabilities once you've voided a paycheck. This will apply to both year-to-date (YTD) and quarter-to-date (QTD). If you've paid it, there's an option to either apply it as a credit or get a refund.
For state taxes, it depends on their policy. You can contact your state agency to verify if they can process either a credit or refund. You'll want to read these articles for more details:
Also, we'll have to file an amended return if there is a correction on your payroll. It is required to notify the tax agencies about the changes by filing an amended return. Check these articles for your guide: