How can I get the music I've put onto my iPhone from CDs onto my new MacBook if theres no CD drive?
You are looking for iTunes Match.  It's a $24.99 a year add-on that will allow you to d/l from iTunes anything you ripped to your iTunes library.  I don't think it works tho from just music already on the phone, it has to be ripped to your library using iTunes.

https://www.apple.com/itunes/itunes-match/