
Fastest low-cost method is to back up, then use the app's built in free up space. On Android, open Google Photos, tap your profile picture, go to Photos settings > Backup, turn it on, set Upload size to Storage saver, wait for the checkmarks to finish, then go to Library > Utilities > Free up space to remove device copies that are safely backed up.
On iPhone, you can do the same in Google Photos and use Free up space, which deletes local copies but keeps them in Google Photos, or turn on Settings > Photos > iCloud Photos and choose Optimize iPhone Storage to auto offload full resolution files without deleting them from iCloud. Important caveat: with iCloud Photos, deleting a photo in the Photos app deletes it from iCloud too, so do not bulk delete unless you have a second backup.