Dig the soil up from around the damaged in-ground sprinkler head with a garden shovel. Only remove about six inches of soil, so you don't reach the sprinkler systems water lines. Exposing the water lines could open the area to further damage and possible line replacement.
Grasp the broken in-ground sprinkler and twist it counterclockwise. Pull the sprinkler from the riser attached to the sprinkler line and the ground.
Take the damaged in-ground sprinkler head to an irrigation supply store or a home improvement warehouse. Purchase a replacement head that matches your original sprinkler in size, spray pattern -- such as rotary head, spray head or bubbler -- and size of threaded female opening at the bottom of the sprinkler -- either 1/2 inch or 3/4 inch.
Clean the riser attached to the sprinkler water line, removing old thread seal tape. Rewrap the threads on the riser with new thread seal tape.
Insert the replacement in-ground sprinkler head onto the riser and twist the head clockwise until tight. Replace the soil around the new sprinkler head.