You want to be sure to backup all your photos to the cloud - Google Photos is fine, Dropbox works, there are many other such apps. Then you can delete everything from your device and the backups will remain in your cloud account, accessible from any device.