I like to make sure that I'm completely warm before I either go in the bag, or go in the pads.
One of the one things I like to do sometimes, is to jump rope. Jump rope is a great way to get a sweat going, loosen up the muscles, which, you then go, and stretch. It will be a lot more easier.
You could jump rope for maybe three rounds, if you're a beginner, sometimes five rounds if you feel like you can last for five, three minute rounds, and the rest.
You start with jumping the rope, and then, just basically, run through joint rotations, hip rotations, loosen up the joints, stretching both sides of the legs, amid rotations. Just make sure that everywhere is stretched nice, and loose, before you actually proceed onto the bag.
Makes sure that, before you embark on hitting a bag, or sparring, make sure you stretch fully. If you don't stretch well, you stand a chance of pulling muscles. You'll feel the fatigue in your muscles a lot sooner, if you don't stretch.
Again, once you finish your workout, to stretch again, eliminating muscles tightening up, and again, maybe pulling muscles at the same time.