You may be able to download a video showing installation of an optical drive by going
here and selecting the particular G4 model that you have. As Joe said, the hardest part can be removing the cables, particularly the power cable, in my experience. If you can't get it free by hand, take pliers, grip the sides of the connector (NOT THE WIRES!) and wiggle it gently from side to side. That worked for me.
Putting everything back is much easier, luckily.