How do I make my pet attack something?

Normally a pet will attack anything that attacks you (spell or melee) unless it is "held" by the "/pet hold" command. You can tell your pet by using the Attack button on the pet window (left click and hold to make a hot button to put on a hot bar). You can also use the "/pet attack" command either by typing it in the chat window or by adding it to a macro. The /pet qattack" command is a special command which tells your pet to use your target as the next thing for it to attack (if currently fighting it will wait until the current taget is dead before attacking the new one).