How to stop enemies getting into my house in Minecraft?

How do I stop enemies getting into my house in Minecraft?

You can use an iron door and put buttons on both sides to temporarily open and close the doors just enough to let you in. Also, normal mobs can't break the iron door. Just watch out for creepers, they might destroy the block under the door, causing it to drop as an item. Happy crafting.

(P.S.) You also need torches inside your house and outside your house to stop mobs from spawning inside. Just make sure your whole house is lit up.

Walls, doors, roof, torches

the basics of a house

If your house is small enough (just one room) and you don't have a bed, you don't need to do anything but enclose it. Mobs never spawn where you can see them. If you have a bed, light it up with torches, because mobs will spawn beside you if it's too dark. Light up a bit around the outside too. Mobs won't spawn directly in the light, and though they probably will wander in from dark areas, there will be less around.

Don't leave any holes in the walls, even for windows. Make glass as soon as you can instead. Baby zombies can fit the holes and skeletons will be able to shoot you. If you're too close to the wall with holes in it then a creeper may explode, since they can see you.

On hard mode zombies can break down wooden doors. Build an iron door or play on easy.

A three-block high wall will keep out most mobs since they can't jump over it, and as long as it's lit up nothing will spawn inside. Endermen (the tall black ones) may teleport in the walls but they're passive unless you look at their face. Spiders will climb over the wall unless you have one block sticking out at the very top (facing the outside of the wall, not inside). Spiders can't climb the bottom of blocks.

Finally in the event that you don't have a house or are far away from it, always bring a bed when exploring. Dig a hole deep enough for you to stand in two blocks wide and cover the ceiling, place a bed, and sleep. The mobs don't have enough room to spawn beside you so you'll be fine.

Kill them.