To compare means to discuss how two people, places, or things are similar.

Ex: Both teachers and students need to spend a lot of time preparing for classes.

To contrast means to discuss how two people, places, or things are different.

Ex: One main advantage of a bicycle over a car is that a bicycle doesn’t create any pollution.