To add to the post above, whip if you can build something that needs 2 pop points. There are several threads discussing the fine points of whipping for production, but the key thing here is if you whip for only one pop point, you take away one unhappy face for "It's too crowded!" but you add one unhappy for "We cannot forget your cruel oppresion!" for 10 turns. Then the city is now one pop point smaller, but still net unhappy so all you managed was to reduce your working population size by one point for 10 turns! So make sure you get rid of at least 2 points in a whip if the city is unhappy to begin with.
Obviously, if the city is very very happy, you can absorb those extra unhappy faces, but then you wouldn't have the situation described in this thread.