It's hard for me to understand what to do
You can ignore the 1099-G, unless you itemized deductions on your 2016 federal return. Don't enter it at all.
A state tax refund is only taxable, if you deducted that same amount on last year's federal return
Please see the below on where to add your form 1099-G for Government refunds: