The continued impressment of American sailors by the British Navy left Jefferson with no good options. It was an affront to the national dignity, but America was in no position to go to war with Great Britain; in addition, to do so would force Jefferson to dramatically increase the size of the American government, which was inconsistent with his core political principles. His response was to apply economic sanctions, in the form of the Embargo Act.
The Act was actually a blast from the past; the colonists had used embargoes to influence Parliament prior to the Revolution. Circumstances had changed, however. In the 1770s, the colonists were British subjects, and had a claim on the sympathy of the British government; in 1807, they were aliens with an insignificant military, and Britain was engaged in a life-and-death struggle with Napoleon. As a result, the chances of impacting British policy weren’t very good.
Enforcing the embargo was unpopular, and made Jefferson look like a tyrant and a hypocrite. One of his last actions as president was to sign the act repealing it.
This analogy obviously isn’t perfect; our nation is far stronger relative to China than we were relative to Britain in 1807. The central point is valid, however; sanctions come with costs, and often don’t work. They definitely won’t work if the public isn’t prepared to make sacrifices when the other side retaliates.