You enter the full amount of the 2021 state tax refund that you received in 2022. TurboTax will ask questions to determine how much, if any, of the refund is taxable.
You separately enter the full amount of state tax that you paid to the other state with the 2021 state tax return that you filed in 2022.
You should have received a Form 1099-G from the state for the refund that you received, or you might have to access the 1099-G on the state web site. To enter the refund see the following FAQ.
Where do I enter a 1099-G for a state or local tax refund?
To enter the amount that you paid to the other state, type "tax paid" (without the quotes) in the Search box, then click the link that says "Jump to tax paid." On the "Estimates and Other Income Taxes Paid" screen, scroll down to "Other Income Taxes Paid in 2022" at the bottom. Click the Start button for "Balance due on your 2021 state taxes paid in 2022."