driving 2 12v 2A DC motors with Mega

I really don't have any idea how to properly connect the sensor. The 4 wires are all different. This is why am looking for advice on here. I honestly know nothing about how all of this is supposed to work.