Do not try to kill the snake. A frightened, injured snake is far more dangerous than one left alone. Attempting to kill a snake dramatically increases your risk of being bitten.
Do not try to capture it. Even non-venomous snakes can bite. Their mouths harbor bacteria that can cause serious infection.
Do not corner it. A snake that can’t escape may become defensive. Give it space and an escape route out of the room (if possible).