Sync iphone music to itunes?

How do i sync my iphone music to my itunes library on a mac?

I have a PC, but it should be the same for mac. There's 2 ways to do it, 1: Go into iTunes and then click iTunes store, than click PURCHASED than click the music you like.way 2: Plug iPhone in, click SYNC than it will take about 2-10 minutes at the most. Thats the only ways i know how. But you will only be able to use way 1 if you have iCloud.

Here is two links with instructions.