Be careful here. If you have a purchased song or album with all the songs on your phone - (some may be in the cloud, some on your phone, so you may need to to this on a song by song basis) - the ... pop up will have an option to "Remove Download". Delete should not appear if the item is on your phone. On the other hand, if an item is not on your phone but in the cloud only, then the "Delete" option will appear. This indeed will remove it from the cloud, meaning you will need to have the original file/song/album backed up, archived, and/or on another device (such as your iMac's hard drive) if you want that item to be available in any way in the future. Purchases should still be available for download, but you'll have to view that item in your iTunes account or via the iTunes store to access it.
You can and probably should turn on Show Music Available Offline - which is under the Playlist tab, tap on the red lettered "All Playlists" (or this may say Apple Music Playlists or even My Playlists). Turning this on will only show you the items that are actually on your phone. This way you'll only see those songs that you can remove from your phone, rather than deleting something in the cloud that's not on your phone. Be sure to turn this back off after you've removed your songs so you have access to them via the cloud for streaming on your phone.
The number one rule is to have a back up of all your music - Purchased, Matched or uploaded so you can access them without any assistance from Apple's cloud or purchased area in your account. Time Machine works great as well as having a master iTunes device where all music is physically on a drive (such as your iMac). This way, you greatly reduce any risk of having either you, or Apple, permanently deleting files. There are a ton of issues with this right now, so be safe and not sorry.
In a further effort to gain space on your phone, you can go to Settings/General/Usage and under STORAGE tap Manage Storage. The next page will populate a list of what is taking up space on your phone. This can help you decide what to keep or remove. You can tap Music to view what's taking up the most space.