A snake indoors is almost always a sign of opportunity, not malice. It has followed prey, warmth, or shelter through tiny openings under doors, cracks in foundations, vents, or unscreened windows. In that moment, your first job is not to be brave, but to be careful: keep children and pets away, close doors to contain the animal, and avoid cornering or touching it. Even nonvenomous snakes can bite if they feel threatened, and misidentifying a species can be dangerous.
The safest choice is to call animal control, a wildlife rescue group, or a licensed pest professional who can remove the snake humanely. Afterwards, focus on prevention: seal gaps, install door sweeps and screens, reduce clutter, and control rodents and insects that attract predators. Snakes are vital pest controllers in the ecosystem, but inside your home, calm distance and professional help turn fear into a manageable, one-time scare.