Remove the hard drive, it's easy on your model iMac.
Put your iMac G5 face down. Loosen the screws along the bottom of the display. Pull up the foot to remove the back. Take out 4 screws around that hard drive.
Put that hard drive in an external case, and you can do what you need to do with the files.
The hard drive has an SATA interface, so you would need a case that will connect that type of hard drive.
Do you mean optical disk? If so just remove the 3 gold Phillips screws that secure the optical in the machine, then pull the optical drive out. Then its just a matter of 3-4 more small Phillips screws to take the optical drive apart and remove the disk.