If someone is about to walk into a situation that could range anywhere from inconvenient to harmful for them, the courteous and fair thing to do is to give them a warning.
For example, you're using a public bathroom, and there's no toilet paper left for the toilet you're using. If someone was waiting outside and is about to use the toilet / stall you were just using, it's fair to warn them first "hey there's no toilet paper left in that one" so they can use a different toilet if they'd prefer (or maybe grab some paper towel from the sink first if they'd personally rather improvise like that).
Another example of this is in many places it's common for cars to flash their lights at oncoming cars if there's any sort of danger or obstacle in the road ahead, like a flooded road, or an accident, or rubble/debris in the road.
Or say you used to work somewhere, and the work environment was really toxic (verbally abusive boss, co-workers who are bullies, they repeatedly "accidentally" paid you less than they were supposed to even after you called them out on it, etc) and someone you know is going to apply working there or was just offered a job there, it's fair and considerate to warn them about your experiences.
Or maybe you took a class that was way harder than you thought it would be, and had a much higher rate of people who fail or drop the class than you anticipated, it would be fair to warn a friend and/or classmate who says they're going to take that class.
The point of giving warnings is that you can save someone else a lot of trouble. Even if they still decide to proceed, it's better for people to go into a situation prepared and knowing what they're getting into rather than being completely caught off guard. Even just knowing about something ahead of time can make a difference.






















