What do trigger warnings actually do?

Are these actually helping other people? Or is it just something we do because we think we’re supposed to?