You will likely have to cut out a section of the PVC pipe (using a hack saw or similar powered saw) and patch in a replacement section of pipe. When working with PVC it is best to use primer first, then cement, if old are dirty PVC use cleaner, then primer, then cement. Primer comes in clear and purple, most commonly found is purple, it is messy though, (purple dye is used so inspectors can confirm primer was used), for cement I suggest using the Blue "rain or shine" cement which will cure if wet unlike clear cement. Working time for PVC cement is only a few seconds (shorter the warmer the weather) so work fast. Some fittings (mostly black ones), work better with orange CPVC universal cement, but even on these it is possible to get reasonable results using the blue rain or shine cement.
Ike
p.s. there are various youtube videos that show to work with pvc pool plumbing