Refinancing replaces your existing loan with a new one, ideally at a lower rate or better terms. But it only saves money if you stay in the home long enough to recover closing costs.
Divide your closing costs by your monthly savings. If refinancing saves you $200/month and costs $4,000 in fees, your break-even is 20 months. Stay in the home longer than that to profit.
Avoid refinancing if you plan to move soon, your break-even exceeds your expected stay, or the savings are offset by extending your loan term.