The ColorRace program demonstrates some example autonomous behavior using the color sensor to react to changes in the color of the surface. You can create a short "course" for the car to drive and mark actions with different colored tape or strips of paper. The color sensor can sense six different colors, and in this example program, the actions for the six color numbers are:
Black: Ignored
Blue: Turn left (start turning at first blue line, stop turning at second blue line)
Green: Speed up to full power
Yellow: Slow down to 30% power
Red: Stop
White: Ignored
The car should be started with the front wheels pointed straight ahead (adjust them before starting the program by turning the knob wheel on the steering motor), and it will start out driving straight slowly.
Note that autonomous operation is tricky, because there is limited control, and the steering has a lot of mechanical "slop" in it, which makes getting a straight start and consistent turns challenging.
You may also need to change the colors used in the program to adjust for the color of your floor and markers used. To test which color the car sees over various surfaces, use the View -> Color feature in the NXT brick menu and roll the car over various surfaces.