Quickly wrote up the following, in my experience these are some of the best ways for new players to get the hang of the game.
Attack:
Scout: Use your agility, flanking and surprise attacks to get the advantage. Learn how each map is structured in order to find paths past the enemy, attack from all angles
Soldier: Use your splash damage, hurt the enemy when you can't see each other. Learn how to affect people's movement with your rockets, aim at their feet to jump them up (very useful for charging demomen)
Pyro: Use your fire to counter each class differently, until they drop dead. Learn how to airblast projectiles in order to defend yourself and your team from oncoming soldiers and demomen.
- Scout - set them on fire, then counter their movement with your airblast - keep them cornered
- Soldier - rush them, most soldiers will end up damaging themselves in close combat. Eventually learn to airblast any rockets away
- Pyro - switch to another weapon (shotgun), or run backwards while aiming your flame at the pyro
- Demoman - airblast stickies they might have prepared - then keep close, like Soldiers, demomen will damage themselves in close combat
- Heavy - quickly get damage before they can spin up, then run around them, dodging any damage they send your way
- Engineer - sentries could be taken down by shooting fire around corners/up ledges, engineers shouldn't be much trouble
- Medic - most medics will try to run, so airblast to keep them where you want them - and burn from there
- Sniper - up close, you shouldn't have much problem - from further away you can use flares to knock their aim
- Spy - constantly spycheck (list below) people and light corners up, don't head into water if you can avoid it, you should be fine
- If they're possible to run through, they're not a spy
- If they're running through buildings (except their own), they're not a spy
- If they're taunting, they're not a spy
- If they're shooting any weapon, they're not a spy
- If they're able to double jump, or run as fast as a scout - it's a scout, they're not a spy
- If they're scoped in as sniper, they're not a spy
- If they're revving up as heavy, they're not a spy
- If they're holding a building, they're not a spy
- If they're healing someone, they're not a spy
- If they're in your spawn, they're not a spy
- If they're touching your intelligence without picking it up, they're not a spy
- If they're capturing a point or pushing a cart on their own, they're not a spy
Defend:
Demoman: Use traps around corners or on the roof to trick players, use them on the floor to scare players. Cover any unprotected areas with pipes. Learn how to sticky jump to cover more area
Heavy: Use your minigun to close down areas, spin up if you're near the enemy - you can spin up without shooting with right click. Learn how to watch out for spies and snipers
Engineer: Use your sentry to cover as much area as possible, while reducing the places it can be destroyed from. Learn how to spot spies and defeat sticky traps.
Support:
Medic: Use your medigun to heal everyone, in order of importance (see list). Learn to fight up close or run away when you're alone.
- Attacking a sentry nest? You should be healing demos/soldiers, but idealy ubering pyros to rush in
- Spawn camping? You should be healing demos, but idealy ubering heavies to keep pressure
- Heading to the fight? You should be healing scouts to get there, then switch to the below list...
- No situation? Heal until on full health (or heavy if everyone is on full health): Medics, heavy, soldier, demoman, pyro, engineer, scout, spy, sniper
Sniper: Use your range as your key advantage, hold down choke points to prevent pushes, kill in order of the "No situation?" list above - but with snipers first.
Spy: Use your stealth, be invisible unless needed - shut down teleporters to prevent enemy pushes, sentries to allow friendly pushes and dispensers to stop camping.