Scientists call snails 'gastropods', because they eat (gastro) with a mouth set into their large foot (pod). Gastropods have lived in the sea as well as on land for hundreds of millions of years. They mostly live in shallow waters.
They include famous shells like whelks - the ones you put close to your ear 'to hear the sea'.
They mainly develop spiral shells and these have very distinctive shapes, so that scientists can use them to tell which species is which. In this way they can be used to tell what kinds of rocks they lived in, and also when the lived.
Sometimes the shell survives, sometimes it gets dissolved away. A surviving fossil shell is shown in the video below. The picture above shows a piece of (Portland) limestone where the shell has been dissolved away. What you see is a cast of the inside.
Modern snail shells are shown in the bottom video.