For example, if I am mad at my wife, I may burn down our house to kill her. Of course, this would be an example of cutting off my nose to spite my face, as in the process of burning down my house I would also destroy my home, and all my personal possessions.
In another example, to protest British and French interference with U.S neutral shipping, the United States Congress passed the Embargo Act of 1807, which prohibited nearly all U.S. exports and most imports, greatly disrupting the U.S. economy.
It is closely related appeal to spite logical fallacy.