The process is the same for both pop-ups and rotors. This is an example of a pop-up replacement.
This pop-up was hit by an edger, slicing the top and breaking the threads that hold the nozzle in place.
If you are replacing this sprinkler head with the exact same sprinkler head and the existing sprinkler head was level with the ground, dig up and expose the broken head all the way to the first fitting.
If the existing sprinkler head was is not level with the ground, you will have to dig up the entire swing joint. If there is not an existing swing joint you will have to add one.
This head was sheared off by a mower because it was not level with the surface. This is a good example of why you might add a swing joint instead of just replacing the sprinkler head the way it was previously installed.
Remove the sprinkler head, if the nipple is damaged, remove that as well. You need to remove all damaged fittings and expose undamaged, usable threads.
Thread on a female or male funny elbow. The photo shows a female funny elbow.
Push on a piece of funny pipe / swing pipe, make sure it is long enough to bend to the position you wish to set your new sprinkler.
Attach and level the new sprinkler head using one barbed funny elbow and one marlex elbow ( street 90 ).
Swing assembly examples.
Thread on the new sprinkler head.
Install / replace the nozzle (example below). Replace the sod and level the ground.