Hey there,
Your question states: "How Did the United States Defeat the Barbary Pirates?"
Answer/Reason: John Adams and Thomas Jefferson were a big help toward winning the Barbary Pirates, based on my research. John favorably paid off the pirates with a constant argument.
Hope this helps.