When you make a public disclosure (this includes things like "releasing a product that uses that method", fwiw), that starts a countdown clock [1]. When that clock reaches 0, that disclosure is now prior art, and anyone who files for a patent after that point is unable to get a patent for that method. Sufficiently old public disclosure invalidates any patent, independent of any filing system for patents.
First-to-file and first-to-invent are instead what happens if you get two different people who try to file for a patent before that point. In a first-to-invent system, there's an adjudication process that's going to look at all of the internal records to figure out who "invented" the process first (which, in the absence of evidence, is going to default to the first person to file anyways). In a first-to-file system, the first person to get their paperwork in the door is going to get the patent.
This doesn't mean that an unscrupulous person gets to look for public disclosures and rush their own patent applications to beat out the original inventor. You still need to demonstrate independent conception of the idea (although this would likely only be demonstrated in the context of an actual trial).
[1] I don't remember it's length, but I want to say it's like a year.