See the following from What's the difference between device storage and iCloud storage? - Apple Support
Free up space on your device
Using the steps above, you might see a list of recommendations for optimizing your device storage, followed by a list of installed apps and the amount of storage each one uses. Tap an app's name for more information about its storage. If you don't see any recommendations, try these steps:
- If you use iCloud Photos and turn on Optimize Storage, you can lower the amount of storage that your photos use on your device.
- You can remove content from your apps like photos, music, and podcasts.
- You can delete apps that you're no longer using.
Learn more about how to optimize the storage on your iOS or iPadOS device.
Also, be aware that iCloud Photos is a syncing service. Any photo you delete from a device where iCloud Photos is turned on will also be deleted from iCloud and from any other device connected to iCloud Photos. You can potentially reduce the storage space required on a device by turning on Optimize Storage. See: Set up and use iCloud Photos - Apple Support
Apple does not currently offer cloud-only storage for photos. If that is what you want or need, you may want to explore 3rd party options such as Google Photos or Dropbox.