Captain William Kidd may or may not have been a pirate. He was a privateer for sure, attacking French ships on behalf of England. His trial for piracy and execution were probably more political than anything, and surviving documents that were mysteriously missing at his trial point to his innocence. His career was not very lucrative at any rate, and he was plagued by bad karma. His crew did not respect him.
But according to hearsay, Captain Kidd, upon learning that he was wanted for piracy, buried a substantial amount of treasure somewhere, hoping to use its location as a bargaining chip for his freedom. His gambit failed, and he was hanged on May 23, 1701. Actually he was hanged twice, since on the first attempt the rope broke, which under some jurisdictions would have been considered an "Act of God" proving his innocence.
Captain Kidd spent his career trying to do the right thing, but his bad luck led him to a probably undeserved fate. But thanks to him we have the classic pirate trope of buried treasure.