Traffic laws are made to regulate the traffic, so people can have a civic way of transporting themselves in different motorized ways of transportation, this prevents from chaotic transportation, and it provides a common understanding among users of the road way, it also promotes safety in the driving enviroment and keeps order and movement of traffic.
They can be implemented by the government, like those that would get you a ticket, or as a courtesy way in the common knowledge, like turning your turn signal on when your are going to change lanes or turn on a corner.