Here's how:
Uncountable:
* When referring to traffic as a general concept or flow: "There was a lot of traffic on the highway."
* When referring to the amount of traffic: "The traffic was heavy this morning."
Countable:
* When referring to individual instances of traffic: "We encountered two traffic jams on our trip."
* When referring to different types of traffic: "There are different types of traffic: car traffic, pedestrian traffic, and bicycle traffic."
To determine whether "traffic" is countable or uncountable in a particular sentence, consider the context and the meaning you want to convey.