This has to be the most fun training you will do with your dog. I always think it's the most entertaining part of watching Crufts. The creativity and hard work really pays off when you see the sheer joy dog and handler have working together on these imaginative scenes.
Heelwork to music is the product of teaching lots and lots of simple tricks and putting them together in a sort of dramatisation or dance routine.
Start with something really simple like spin. So you teach your dog to spin in a circle at the same time you do.
Start with your dog in front of you.
Have a tasty treat in your hand close to your dog and have your dog follow it round in a circle. Most dogs do this naturally. When your dog completes the cirle, click and reward.
Practice this til your dog understands you want them to go round in a circle, then add in a verbal cue- "spin".
Practice with the varbal cue until your dog is reliably following in a circle.
At this point you can start making your hand luring more subtle. Move your hand further away. Keep using the verbal cue too.
If your dog is understanding then they will continue to spin, gradually move your hand further back.
Soon your dog will spin with a subtle hand gesture.
The next step is for you to spin at the same time as your dog!
Start luring your dog and continue moving in a circle so you are both going round at the same time.
Once you have this step mastered, you can teach your dog to spin (You can give a verbal cue of 'twist' for going the other way) in the opposite direction.