You can add trigger warnings at the beginning or in a prominent place of the story. Just clearly state the potential sensitive topics like violence, abuse, or trauma.
One example of a scary bedtime story with a warning is 'The Red Room.' The warning in it is about the red room being haunted, and the character is warned not to stay there overnight. But of course, they don't listen. This leads to all sorts of spooky encounters.
Warnings in scary bedtime stories often serve to heighten the sense of danger. For example, a warning about a haunted house might say 'Don't go near the old oak tree at midnight.' It creates suspense and makes the listener more cautious about the events that are about to unfold in the story.
The warnings of science fiction can be diverse. Firstly, it warns about the danger of unregulated scientific experiments. We see in some stories how experiments gone wrong create monsters or uncontrollable situations. Secondly, it warns about the negative impacts of over - population. Limited resources and overcrowded living conditions lead to chaos. And thirdly, it warns about the power of big corporations. They might control every aspect of people's lives, suppressing freedom and creativity as depicted in some science fiction works.
I believe fiction should have content warnings. It gives readers a heads-up and allows them to decide if they're in the right mindset to handle the material. It also shows consideration for different readers' sensitivities and experiences.
Well, dystopian novels usually convey warnings by highlighting social, political, or environmental issues. For example, they might show extreme forms of totalitarian rule or ecological disasters to warn us about the risks of ignoring these problems in the present.