In dealing with snakes, other than poisonous ones, you first must search yourself for your level of tolerance. There is nothing bad about a snake being in your yard or outbuilding. They eat mice and insects, toads and frogs. They can be destructive if you have a water garden with frogs and small fish. The important point is they are not bad.
Most children are not afraid of snakes until an adult tells them to become afraid of snakes. From the first time a child is cautioned about picking up a snake, 90 per cent of humans are constantly reinforced about being afraid of snakes for fear of being bitten. A six foot black racer can put the fear of god in you by hissing and shaking its tail like a rattler, but they do not want to harm you. They are interested in you not harming them and they are telling you, you are too close.
The sad part is that snake scared the daylights out of you because you were reaching in the flower bed to pull a weed and the black snake is what you found. The natural reaction is to grab a shovel and cut that snake into two pieces. Instead of doing the ultimate kill scene, call the local game protector. That person may know someone in the area who will catch the snake and release it some place other than your yard.
If the snake is a little garter snake or ribbon snake, shame on you for slicing it in two. Garter snakes do not bite you and if you leave them alone, they will not bother you. Not knowing what kind of snake it is, is not an excuse. There are field guides available for snake identification and local libraries have reference books with colored pictures. Take a little time for identification before you wipe out a harmless, good snake.