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.