Snakes can enter through small gaps under doors, cracks in walls, vents, pipes, or cluttered areas. Basements, laundry rooms, storage spaces, and places with rodent or insect problems can attract them because they offer hiding spots and possible food.
The safest response is to stay calm and keep your distance. Move children and pets away, close off the room if it can be done safely, and call animal control or a wildlife professional instead of trying to handle the snake yourself.
Afterward, prevention matters most. Seal openings, reduce clutter, trim grass and vegetation, and deal with any rodent issues. You cannot stop snakes from existing, but you can make your home much less inviting to them.