You can set your device to automatically delete apps to save space, while retaining settings and files in case you wish to restore the app later.
To activate it, go to Settings, tap General, and then tap iPhone Storage. Toggle the option for Offload Unused Apps to on.
Now your device will automatically delete the apps you rarely use when it senses that storage is running low. The app icons will appear grayed out on your Home Screen. To restore them, simply tap the icon and wait for them to download again.
Alternatively, you can choose specific apps to offload yourself instead of having it handled automatically. From the iPhone Storage menu detailed above, scroll down to view a list of all your installed apps in descending order of size. Tap one and then press Offload App.
Note that it is not possible to offload certain “core” apps like Messages and Photos.