A quick way to tell them apart is by the head: venomous ones usually have a more triangular and defined head, while non-venomous ones have a rounder head that's more similar to the neck. That said, it's not a golden rule everywhere, it really depends on where you live because there are very different species depending on the region. In my area I've seen quite a few water snakes and grass snakes around the place, and honestly most of the ones you find in the garden are harmless, so the first thing would be to identify exactly what species you have - if you can get a clear photo, there are apps and herpetology groups that'll help you out right away. In the meantime, the safest thing is to leave it alone and let it go, because these things don't attack unless they feel threatened.