Just like you stretch before exercising, you should do the same before you start playing your guitar.

Warming up before practicing is fundamental because your hands need to be well supplied with blood to enhance your flexibility and efficiency, and prevent injuries. When warming up, you're mentally and physically preparing yourself for playing the guitar.
So here are 4 warm-up exercises you should start doing before practicing:

#1 If it's cold: Wash your hands with warm water

Playing the guitar with cold hands is the worst. So the first thing you should do is running your hands under warm water, it will improve your blood circulation, loosen up your muscles and it will help to prevent injuries.

#2 Massage your hands

By taking on work that needs to be repeated several times, the hand muscles tend to tighten up. In order to loosen them, get a hand massage. Massaging your hands will also increase the blood flow in the hands.

#3 Play something that is not demanding for your hands

Try playing some simple exercises, melodies and/or chord progression. Here is an example of an exercise you can do as a warm-up:

#4 Light stretching exercises

The last thing is lightly stretching your fingers but take it easy. Don't do it when you are feeling uncomfortable or if you are injured. Stretching your fingers helps to enhance flexibility, it lengthens tight muscles and it also helps to prevent injuries.

Be sure you're warming up before playing the guitar, by having a good routine in place, you'll be able to enjoy the guitar for as long as you wish.