What is the meaning of [don’t cut off your nose to spite your face]

Do not take action to spite others that will harm you more than them.