Hey look, I've got two spaces in my wall and I want to put doors in them. So, let's do that. To make a door, you're going to need either wood or iron. Wood is the easiest and most common, obviously. You're going to put six planks right here, nice and easy. Iron ingots, guess what, same thing. One, two, three, four, five, six and then you have an iron door.
So, to place a door, you just drop it like that and you'll see that the door's going to be on the side that you put it on. As you can see, I have pressure plates here and that's going to open the door. So when you walk into it, it will just automatically open the door and then that other one is going to close the door. Otherwise, you just right click to open the door and iron doors can actually not be opened by clicking. You'll see this one easily opens and closes every time I click it but this one does not but if I drop that, boom, open door, close door, open door, close door.
So, these are good for security. If you are playing on a multi-player server, you can keep people out by putting a switch inside but you need to have another entrance obviously but it's good to make a one-way secret exit, kind of thing.