Why does a car slow down when you accelerate?

A car goes faster when you accelerate. It slows down when you brake.