There are a few different ways to do shadow boxing.
1. Slow shadow
This is a good way to practice your techniques, or as a warm up.
Move slowly and focus on the technique, and proper movement.
2. Speed shadow
Throw each technique fast. Try to improve the speed of your technique.
3. Stamina shadow
Try to keep moving for a certain time as hard as you can.
Try to keep the right technique and speed when you are getting tired.
4. Visualize your opponent
This is the most important and useful shadow boxing.
Visualize your opponent in front of you, and think about their reaction when you throw a punch and kick, or visualize your opponent throws punches and kicks, then you react to defend and counter.
This helped me a lot to improve my technique when I was learning.