That's a good question. I did a lot of research ahead of time.
And some of the suggestions were to clean your meditation space, put on soothing music with no words, and things along those lines. I had a video like this one running on my screen. My wife came in and checked up on me after a period of time.
It sounds like people who have bad experiences usually take too much, and are in a environments with too much stimulus, unknown people, etc. My experience didn't have any stress to it, mainly just nervousness before the fact.
I've heard that about marijuana, too. One thing my therapist said was that marijuana can be like a giant, inward focused eye, that reveals everything bad and troublesome and anxiety inducing about yourself, but that mushrooms are an expansion of the consciousness outward. If you do things to foster that outward gaze, instead of gazing too deeply inward, you will avoid what people call a bad trip.
It's also helpful to have an intention before you start, although in my case, what I felt I learned about myself or worked on were not what I'd been planning going in. I've been starting to feel the effects wear off, and will probably try again in May or June, which feels like about the right interval, and it will be interesting to see if I have the same experience.