I am trying to program a raspberry pi 3 to run a traffic light on a breadboard.I also have a sensor that detects color of the traffic light, which is connected to the same raspberry pi. Can anyone help me with this? How would I do that, and also HOW can I send that detected information to another raspberry pi? 
Thank you!
You can use messaging protocol like RabbitMQ, MQTT tech to make an easy communication between the raspberries.
But another Simplest way is to develop HTTP REST endpoints if you don't have stron background in messaging protocols (MQTT).
Easy way is develop HTTP REST endpoints using python flask.

Suppose you have a method in python flask as turnOnLED() bind with a URL as /on on Raspberry PI X. Now you can call this REST Endpoint using the IP of this raspberry X from another Raspberry Y.
You can similarly write a method in python to interact with **GPIO** and make that method available through your URL (ip/endpoints) to another Raspberry. From other Raspberry you can call that method by calling the URL for the first one.


Make research on RESTful APIs using Python, GPIO, PGPIOD, WiringPI, Pythong flask or any other framework to write REST Endpoints rapidly.
You need knowledge in all these buddy.
Running Traffic Light with Pi and Sending that info to another Pi