See Subscribe to iTunes Match - Apple Support or Join Apple Music on your iPhone, iPad, iPod touch, Mac, or PC - Apple Support for options that would potentially allow to store less music on your device which retaining access to it. See also How to check the storage on your iPhone, iPad, and iPod touch - Apple Support and consider offloading apps you don't use all the time. iCloud Photo Library - Apple Support might let you store fewer photos on your device while still keeping access to them, however make sure to take a backup on a computer before you start as it is relatively easy to permanently delete something from the cloud in error.
tt2