We have all seen it before, a sprinkler head that is stuck in its extended position and doesn't retract. While this is a broken sprinkler, all hope is not lost as long as you get to it before the mower does.
Many things can cause a sprinkler head to stick open and to stop retracting, but the most common is just age. Sprinklers are made of plastic and as plastic ages it becomes oxidized and rough. This roughness is usually what causes a sprinkler head to stick open. This is often times a temporarily broken sprinkler and we have a chance to try fixing it, however a stuck open sprinkler often remains hidden in the grass and eventually gets run over by the mower blades turning it into a permanently broken sprinkler.
If the sprinkler will retract when tap on it, you can usually repair the problem and extend the life of the sprinkler. If it will not retract at all, it is time to replace the sprinkler. If the sprinkler will retract when you tap on it, then using a cloth or pliers, hold the sprinkler open in the extended position and clean any dirt or debris off of the sprinkler shaft. When it has been cleaned, while still holding the sprinkler, extend and retract it several times before releasing the sprinkler head and see if it will close on it own. If it will close on its own then move on to the next step, but if not then it is time to replace the sprinkler.
If the sprinkler is functioning as expected on it own, but just needs a little help to stay in service longer, then using a cloth or pliers hold the sprinkler open and after it has been cleaned as described above, smear petroleum jelly (Vaseline®) on all sides of the sprinkler shaft and extend and retract it several times to work the petroleum jelly into the sprinkler body. Petroleum Jelly will both repel water and lubricate the shaft and sprinkler body to keep your sprinkler going!