You will have to open the phone up, disconnect the battery then screen and front camera, now disconnect the rear cam and remove it. Now you have two options, either replace the lens glass only or the entire lens with ring. I advise the lens only, to do this, heat up the lens and push it out(from the inside), remove any remaining glass and adhesive from the lens ring, apply a small amount of glue to the ring and seat the new lens. Allow time to dry properly before reassembly (if not, then the fumes from superglue will fog the new lens). For lens and ring you will need to break off the rear cam retaining bracket from the outer lens ring using pliers, there is a risk doing this that you may damage the glass back (though I have never broke one).