How Do I Retrieve Pictures & Videos From Old, Cracked iPhones?

I have two old iPhones. One is an iPhone 3GS. The other is an iPhone 4. The 3 is slightly cracked at the back. The 4 is cracked wide open at the back and the side.

How do I retrieve data from these phones? I am only really interested in photos, videos and, if possible, text messages.
Are they by any chance backed up to iCloud?
On a computer, go to iCloud.com, log in, and see if they are there.

Original thread: https://forums.imore.com/threads/how-do-i-retrieve-pictures-videos-from-old-cracked-iphones.414425/