Yes, you can use iCloud to free up space on your iPhone. Once you upload your photos and videos to iCloud, you can then either (1) delete local copies on your iPhone or (2) enable the Optimize Storage setting so your iPhone only saves smaller copies of the original in local storage.