Cut the pipe just past the tee fitting and the pipe will stick out of the tee to cap it. To remove the sprinkler from the fitting, you have to dig up the dirt around it. The pipe is no longer connected to the irrigation system, so it can be abandoned.
Let's Get It Fixed!
HomeX virtual experts will assess your issue (for free!) and can resolve simple problems.