There are four terms associated with piracy: Pirates, Buccaneers, Corsair and Privateers have been used sometimes in erroneous contexts making the distinction between all four blurred.
Pirate is the most general of these four terms. From the Greek peirates, meaning brigand, the term is applicable in a whole range of nautical misbehaviour, as long as there is a boat on water involved. These nefarious activities can include coastal raiding, and intercepting of ships in international waters, robbery, kidnapping, and murder all fit within the job description of a pirate.
A Privateer is a pirate with papers. These private ship owners were given written authority to conduct quasi-military activities. in their privately owned armed ships, robbing other vessels belonging to a rival country specifically Spain which had claimed a large part of the Americas between the 16th and 17th centuries which the English Dutch and French wanted a part of. Only when these Privateers went off-grid and ransacked other nations' ships did the distinction between Pirate and Privateer blur.
Buccaneer is specific to the Caribbean and the Pacific coast of Central America. Boucan, in French, was a grill for smoking meat. The term meant French wild game hunters living in western Hispaniola (eventually Haiti) in the early 17th century. They hunted wild game for sustenance, but they were opportunistic pirates as well. Over time, the buccaneers became multinational pirates, and they migrated to Tortuga which they used as a base.
Corsair is also location-specific. They were Mediterranean privateers but with added religious connotations as the conflict was between Muslim and Christian powers. The worst corsairs were the Barbary corsairs of North Africa, who were aligned with the Ottoman Empire but the empire was unable to control them. Conversely, the Christians were the Knights of St. John, based in Malta and this group attacked the Muslim commercial shipping traffic in the 16th and 17th centuries.
https://peacepalacelibrary.nl/blog/2019/pirates-buccaneers-and-privateers-concepts-international-law#:~:text=Buccaneers%20are%20usually%20distinguished%20from,when%20general%20peace%20was%20restored.
https://www.britannica.com/story/pirates-privateers-corsairs-buccaneers-whats-the-difference#:~:text=A%20privateer%20was%20a%20pirate,belonging%20to%20a%20rival%20country.