Three main ways:
1 "Swimming". S-shaped waves move down snake, weaving through plants, stones, or of course water.
2 Creeping. Some fatter snakes move the broad scales on their bellies. Each scale joins to a pair of ribs, and these are moved in turn to push on the ground like a millipede's legs. Can be combined with 1, but some will do it when stretched straight out.
3. Side-winding. Some do this a lot (eg desert vipers & rattlesnakes), but others only on smooth surfaces. It's like 1, but alternate loops are lifted off the ground making the snake "roll" to the side. Leaves J-shaped tracks.
4. Yes, one species can flatten its body and glide from tree to tree.