As a GM
As a GM you rely on trust and communication to make your game work. Your job is to transport 4-6 people (or more, or less) to another world where they get to be heroes, villains, anti-heroes, or the most bizarre set of janitors ever. You need to suck them into this world, help them suspend their sense of disbelief, and get them into the game. But what do your players need from you in return?
Your players need to know that you won't hurt them out of the game. This can be as simple as not insulting tem because of their character or choices, to as complex as not pushing a situation past the boundaries where they feel comfortable. Your players need to trust that they are safe with you socially, emotionally, and physically. Often times as the GM your job is to hurt the person your players have made to explore the world, and that has to happen in a way where the player doesn't feel like the one being attacked.
This also means that as the GM you need to be responsible for the comfort and safety of the players. This means stopping activity that is making someone uncomfortable - whether it is Sarah's tendency to go into detail about how she prepares her kills for the stew pot, or Lance's constant moving of his chair to be closer to James, despite the fact that James doesn't like people sitting that close to him.
Finally, your players need to trust that if they come to you with a problem or issue that you will take care of it, and do so in a way that doesn't expose them to further harm. Trust me, one of the fastest ways to never have a player tell you about problems it to bring it up to the table as "So
You earn this trust with communication. By communication I don't just mean in game around the table, but also out of game. Expectations of player behavior need to be clear. Means of addressing problems need to be clear. When a matter is not fit for the table needs to be clear. These are all part of communication. Players should also know how they can get a hold of you, and they should ideally have multiple paths. Anyone can talk to you at the table, but what if they want to talk to you privately? What if verbal communication is hard for them (I know it is hard for me.)
Keep the lines of communication open. Check in with players, both as a group and individuals, to make sure they're ok with things. I frequently email my players if they seem off or down to make sure that things are ok and they're enjoying the game. It also lets me talk to them and see what we can do to make it even more awesome for them.
As a Player
You're not free of responsibility as a player. You have a role to play in this both to your GM and to your fellow players.
With The GM
Your GM needs to be able to trust you to bring problems to them and give them a chance to fix the issues. They need to be able to trust that if you say everything is ok, that everything is ok, and that you'll tell them if something needs to be fixed. Beyond this, your GM needs to be able t trust you won't argue every rule or ruling they make, and that you will bring up disagreements in a civil manner.
Basically, your job is to give the GM what they need to do their job. That means communicating issues. Giving feedback on things you like/don't like. Being respectful about disagreements. And being willing to let the GM have the final word on a matter in the game.
As a note the GM having final word on a matter doesn't mean you have to agree. It also doesn't mean that you can't leave the game. Never stay in a game you're not having fun in, or feel unsafe in. It's not worth the stress.
With Other Players
For the most part the GM counts as another player here too, but your fellow players need to feel safe with you. They need to trust you to respect their boundaries. They need you to communicate your boundaries. They need to know that if they say stop you'll say "ok" and not make a case for why stopping isn't a rational response to the situation at hand.
Your fellow players should also be able to trust that you will stand with them, not against them, if someone is making them feel unsafe at the table. It takes a lot of courage to speak out and having the table turn against the person making noise is only going to make matters worse.
A Final Note On Safety
Most of this post basically boils down to the group, as a whole, needs to trust that the group is a safe place. Safety is a big deal for me and for my games. I like to use games and the stories in them to explore characters. I like to push the PCs to their limits. I like to keep my focus not on what can my players accomplish, but what will they accomplish under certain stimuli. It makes for interesting and entertaining games with fun characters, but it can't exist without everyone feeling safe.
Believe it or not, your table top RPG is a group of people getting together for the purpose of lowering some boundaries and exploring a world of fantasy, magic, and/or some other twists that make it not like the real world. Respect that. Respect the trust. Don't violate it, because once that magic is gone it might never come back.