I am going to show you like I did mine in my rpg, Prophecies Solar & Lunar.
- Make your room you want the door to be at.

- Make your door and switch. like shown above.
- In the door event make the event processing to say "The door is locked" to let the player know that the switch opens the door.
- Next, make a new event page on the door. Have the door opened in the graphic. Also have it to only use if switch "whatever you name the switch" to show.For example mine is DT-DR.

- Now go to the switch itself. Put the following in.

- Lastly make a new page on the switch. Make the switch have the graphic pull downed. Also have it to be on self switch A to have the page to be opened.
There we go. All you have to do is make a conditional branch like I showed you. Hope you understand it and good luck on making rpgs,