If you enable iCloud Photos, your iPhone can manage this for you automatically.
On your iPhone, go to Settings > Photos and toggle on iCloud Photos to upload all your photos to your iCloud account (note, this process can take a long time, but it will run automatically in the background and only when you're on Wi-Fi).
Below that, you'll see two options: "Optimize iPhone Storage" and "Download and Keep Originals." If you select "Optimize iPhone Storage," iOS will automatically replace full-size photos in your local storage with thumbnails as space is needed, with the originals stored on iCloud. You can still browse your entire library locally, and if you tap on a thumbnail to view the full-size photo and it isn't already in your local storage, it will automatically download from iCloud in the background. The original will then remain in your local storage until iOS next decides to purge it, again based on available storage space.
You can see how much storage space you'll save before the full upload is complete (or even before you turn it on at all) by going to Settings > General > iPhone Storage and looking under "Recommendations." In my case, my full photo library is 48.53 GB, and turning on Optimize Photos would save 47.02 GB – a 97% reduction! (I leave it off only because I have a 128 GB phone and plenty of available storage space).
You will likely need to purchase iCloud storage to fit all your photos, as your iCloud account only comes with 5 GB for free (in 2019, ridiculous!). However, 50 GB of iCloud storage only costs 99¢/month, and 200 GB of storage is only $2.99/month (you can also share 200 GB and larger plans with family members). I find it well worth it for the peace of mind having an online copy of all my photos, and for the ability to keep them in sync with my other devices (Mac, Apple TV, iCloud.com in any web browser, etc.).