Assuming it is stuck on your lens, and you are trying to remove it: Get a sheet of silicone rubber (or some other grippy material that won't damage the glass) and press on the filter gently but firmly towards the lens, face on, while turning it to unlock. Don't squeeze the sides, but press the ring, preferably all along the rim, not inwards or sideways, but in the direction of the camera.

In general, aluminium-barrel filters tend to do this, the brass ones less so.

If your filter is off but won't attach, then the barrel is too dented, and you'd be best off replacing the barrel while retaining the glass, if it's worth it. Some filter manufacturers will do this for you.