You're thinking of the Marquis de Lafayette, who served admirably in the Revolutionary War. Jean Lafitte was indeed a pirate, and no relation.
Lafitte helped us defeat the British at the Battle of New Orleans in 1814.