Everything you send or receive through your Messages app is stored on your iPhone. This includes photos, videos, .gifs, and images. Combine this with the photos in your Photos app, and apps you have downloaded, and you can easily eat up storage on your device.
One slow way to clear storage space is to open the Messages app and select a message thread. From here you can tap on the "i" icon in the upper right hand corner to access all the sent and received images and attachments for that selected thread. Lightly press and hold any image or attachment, then tap the "more" option in the pop up menu. This will allow you to individually select each image and attachment to mark it for deletion. Just tap the trashcan icon to delete the selected images or attachments when you're finished.
A better way to quickly delete large attachments, which are typically videos sent through the Messages app, is to navigate to Settings > General > iPhone Storage > Review Large Attachments. From here you will see a list of the largest attachments stored on your device. You can tap each attachment to review it, or tap the Edit button to individually mark each attachment for deletion. Tap the trashcan icon to delete all the selected attachments when finished. It is located in the upper right hand corner, not the bottom like in the Messages app.
Attachments in the "Review Large Attachments" section are listed from largest to smallest. This allows you to delete the biggest attachments taking up the most space, and it is much more efficient than deleting a bunch of smaller files through the Messages app.Now you can then go back to iPhone Storage section and see how much space you have restored on your device.