I just need a clarification here. When i purchase a CDN traffic, how exactly does it work? Do i store my media files on my server or i have to store the media files with the CDN provider? If someone has for example 500GB of storage media files, what is best if one needs a CDN? Will i need to pay for storage and then traffic when using CDN? or can i pay for only traffic if i host my media files?
You should store your files on the CDN provider, and yes you pay for both storage and bandwidth. To put it in the simplest ways, your visitor is accessing your content through any server who has nearest hop with him.
CDN works in both ways, you can host your the static contents on your server or CDN providers server. The content will be delivered from the closest edge server.