Exposure and Response Prevention therapy works. You will never get fully well without exposure. However, it requires that you find stimulus of a magnitude that makes you uncomfortable, but doesn't send you outright spiraling. You need to keep steady while experiencing it for a while.
Content warnings give you the ability to estimate what intensity of negative stimulus you will experience, and this is important when dealing with actual triggers.
Not everyone is yet at the phase where they can handle a certain level of exposure. For some unfortunate cases it takes a long time to be well enough to start being able to handle exposure.
That being said, I do think content warnings need to be specific, not generic. The most useful ones are spoilers, not generic messages to put you on guard. Careful Ao3 authors do a better job at this than most games. There are technical solutions that allow interested parties to get this information without having to spoil the default audience, but we live in a busy world that has a lot of things to care about other than this.