If possible, isolate the snake by closing the room door and blocking the gap underneath with a towel. Avoid trying to kill, corner, or capture it, because a frightened snake is more likely to defend itself. Instead, watch where it moves from a safe distance and contact animal control or a professional wildlife removal service.
After the snake is removed, inspect your home for possible entry points such as cracks, gaps around pipes, doors, windows, and vents. Keeping grass short, removing wood or debris near the house, sealing openings, and controlling mice or insects can make your home much less attractive to snakes.
Most snakes are not looking to attack people and many are actually helpful because they control rodents and other pests. Seeing one snake does not necessarily mean there are more, but if your home provides food, shelter, or easy access, another may eventually appear. Staying calm, calling the right professionals, and preventing future entry are the safest ways to deal with the situation.