I’ve heard it said that the skills used in playing the Pyro extend as far as the use of the left mouse button and the ‘W’ key. While starting to play the Pyro doesn’t require any explicit instruction (unlike classes such as the Spy) playing Pyro like that won’t get you far unless you’re playing other newbies.
What is the role of a Pyro?
Valve has it as offence, but even in an assault team of Soldiers and Heavies, the Pyro’s job seems to be spychecking, rocket tennis, or catching anyone coming up from behind. The short range screams defence, yet Demomen and Engineers are clearly better defenders. Personally, I’d say the Pyro is a support class, far more so than the Spy (offence), Sniper (long range defence) and perhaps even the Medic (the most effective offensive action in the game is surely an übercharge).
The first thing to remember with the Pyro is that runing at almost any enemy head on will kill you (details below). This makes you useless as an offensive class proper (aka tank) unless you have an übercharge - and even then, you need good positioning. Your offensive role is usually disrupting the enemy defence, rather than breaking through it. You might be flaring enemy Snipers, or trying to sneak up on them. Though you can’t rush at an assault team, you can take them all out in seconds with the right approach. Foremost in your mind must be “where is the enemy, and what is the enemy doing?”. This will tell you what direction to approach the enemy from. If they are on a cart or control point and in conflict with your teammates, you should find a way round so you can take them all out from behind. If they are pushing forward, find a convenient hideyhole to attack as soon as they get past. If there’s lots of conflict, catch them oblivious as they race from their spawn point. Or if their Medics are hanging back, it is your job to hunt them down before they fill their übercharge meters - and if they’ve already got them, it’s up to you to sacrifice yourself so they fire off too early to use the übercharges on your team’s sentries.

Then there’s defence. Enemies that would normally retreat or keep their distance can’t do that when they need to push a cart or capture a control point. On the other hand, keeping behind a corner, setting attackers on fire, and retreating to the next corner can take fifty health points per enemy you set on fire per corner, plus any initial damage. Meanwhile, you get to choose which corners you use, and you have time to go back and restock; on the other hand, if one of them hangs back, it slows all of them down. If you have a good Spy on the team, try to co-ordinate, or at least be aware of what they’re up to - don’t chase enemies they’re stalking, or they’re more likely to notice, and kill you both. If they sap a sentry, you may need to finish it off before the owner can fix it. And if they’ve just been found out, the enemy will in all likelihood turn a hundred and eighty degrees to shoot each other, which would be a perfect time to backburn them all from the front, so to speak.
In control point and payload maps, consider team goals. As red, your objective is not simply ‘defence’, but also forcing blue to waste time. If you can’t get round the enemy (as may be the case in Goldrush stages one and two just before/after the first capture), don’t just sit and wait - consider rushing in at close quarters, while the terrain is advantageous, and ignite as many as you can. You might not get any kills at all - but you can cause them to scatter, breaking the lines for a Heavy to come in and mow them down, or forcing them to wait and heal back up, or giving Engineers time to upgrade. When you respawn, you may be quick enough to get the ambush you were after anyway. As previously noted, Medics are a primary target.

Players are rarely this calm whilst on fire.
As blue, your objective is not simply to push the cart or capture the point, it’s to force red to spread their defences thinly, and disrupt them where possible. Your speed means you can pop in and out of doorways, harassing Snipers, sentries, and Heavies with your shotgun or flare gun - with the threat that if they don’t cover it, you’ll be coming out in force with the flamethrower. Forcing red to set up sentries to watch obscure routes is a victory for you, because an Engineer must spend most of their time keeping the equipment spy-free, while you need visit only now and then to make sure they’re still defending the place. Finally, there are cases where you can take out sentries without an über. If you team is being mauled by one, come from another direction - if it is still busy slaughtering your teammates, you can usually finish out, Engineer included, even if there are other enemies about. Sure, you’ll die, but by the time you get back, you’ll only have a poxy level 1 sentry, which you can often take out on your own. Again, Engineer included. Meanwhile, your teammates push on.
The skill of the Pyro - aside from being able to keep your crosshairs on the enemy Pyros - is about assessing the situation, and reacting to changes, constantly being aware of your teammates’ abilities, locations, and activities. This observation is not always easy when your short range makes you wary of the sorts of open spaces that give you the view you want. You need to keep an eye on the kill notifiers and listen for the clues that tell you what is going on in the rest of the map. A (sobering) comparison will tell you that for any job (bar spychecking), there’s another, better class - you’re a Spy with no cloak or disguise and a less effective backstab, you’re a fragile Heavy with a two metre range, you’re a weak Sniper with a bit of a parabolic drop on the flare canister, you’re a demoman who needs to get up close before blasting your enemies into the air. But of the four ‘tough’ classes, you’re the fastest, which is why it’s up to you to cover while the reinforcements get there. Plus, as you’re most useful in the thick of danger, you will very often die (average lifespan: circa 35 seconds), and so you’ve most frequently got the opportunity to swap out to the class whose job you were doing until you got yourself killed. In short, you are a temp, and as such, people will already have decided whether they will trust you or blame you: you can either approach the thrill of it with enthusiasm, or let temping make you a bitter cynic.
If you’re still not convinced that the Pyro isn’t a skilless overpowered newbie kamikaze class that unbalances the entire game, here’s a run through of how any class can kill a newbie Pyro that follows the ‘W’+Mouse school of assault.
The Scout vs the newbie Pyro
“Where did he - ow!”
Scouts will retreat while blasting you with the scattergun. Two good hits (or one critical) with this thing will take you down, and any good Scout will be able to hit a charging Pyro twice. They are also able to get to a medkit quick enough to stop the burning, even if they do run into the flames.
The Soldier vs the newbie Pyro
“My ‘W’ key doesn’t work!”
Soldiers will rocket the ground beneath you - you’ll lose all forward momentum and be sent a few feet up in the air - by the time you land, they’ll finish you off. Or they’ll just hit you directly, in which case, you’re dead. Alternatively, they can rocket-jump and shoot you while you’re out of range.
The Pyro vs the newbie Pyro
“Er…”
If you attack an enemy Pyro head-on and they retreat at the right time, their flames will catch you, but yours won’t hit them. They’ll also shotgun you while you approach.
The Demoman vs the newbie Pyro
“Splortch.”
If they haven’t blown you up with their stickies, one direct hit from a pipebomb will finish you off, with a nice splattering sound.
The Heavy vs the newbie Pyro
“I’m almost there…”
Minigun, shotgun, fists. Pretty much the only thing they can’t kill you with is a sandwich. Just don’t get in the line of sight of a Heavy.
The Engineer vs the newbie Pyro
“Hey, you’re not supposed to be able to fight back!”
Engineers are like Scouts, but slower. The shotgun can kill you, if they have a good aim and enough distance. Three decent shots is often enough, but two close ones or single crits can sometimes take you out. Oh, and then there’s the sentries.
The Medic vs the newbie Pyro
“Just stand still and die!”
Yes, Medics can kill you. They will retreat, firing the syringe gun, and they are faster than you, so long as they don’t bump into anything. Most good Medics have the blutsauger, so even if flames are sapping their health, they are getting it back off you each time they hit.
The Sniper vs the newbie Pyro
“Huh?”
Headshot as soon as you turn the corner. Good Snipers can even do it from just outside flamethrower range.
The Spy vs the newbie Pyro
“Caught you - hey!”
Revolver while retreating. Spies are perhaps the least good at this, requiring three hits, or one plus a critical. But it’s rare that newbie Pyros charge into a front line populated with Spies.
Stop jousting, get organised!
Play Pyro like that, and you will die. Again, and again. Trust me, I’ve tested this theory often enough: don’t let that downward spiral drag you into charging that sentry one last time. Even with prudent use of the shotgun, your chances are still slim against many opponents, and the ones who can’t kill you in seconds are all fast enough to run to get help. Sometimes it does work, but those times are rare, even rarer if you’re not picking the moment and the route carefully. The kamikaze Pyro as an effective class doesn’t exist - but as a free kill for the other team, the kamikaze Pyro is abundant.
So finally, a word to anyone who likes to rail against “newbie Pyros” - if you’re on their team, that Pyro that just rushed into the enemy lines might have saved enough time for your Engineer to upgrade the sentry, and that other one that disappeared off into nowhere might be causing no small amount of grief to the enemy Engineers trying to turn point C into a sentry nest - ask yourself instead if the Pyro’s doing anything you can capitalise on. If you’re not on their team, then don’t tempt fate - for as you watch that not-so-sneaky Pyro somersaulting at the touch of your rockets or frolicking amongst your minigun bullets, you might suddenly find yourself with a knife in your back, a bullet through your head - or another Pyro finishing you and your guffawing teammates off. And for the sore losers among you, calling Pyros newbies after they send you back to respawn really doesn’t make you look good. If you’re one of those people, I’ve just told you exactly how to kill a Pyro that presses the mouse button and the ‘W’ key, even if you’re a Medic, so you now have no excuse.

Kovorka illustrates why Pyros have an average lifetime of about 35 seconds: if it weren't for the spycheckers, the figure would be less than 25.