In general there is no shame in rage quitting, take a break and think about why you are failing and how maybe you should improve your strategy. Sometimes just taking a break to make a sandvich and thinking about a game you will find you are better when you go back in.
Any specific questions go here:
http://tf2wiki.net/wiki/Main_Page
I also highly suggest you search youtube for things like "TF2 How to play..." for different classes like "TF2 how the play pyro"
Class specific tips:
Medic = HEAL EVERYONE YOU SEE. I cannot emphasise this enough, do not just keep healing the same person as that is the worst noob tactic. Only keep healing someone who is in a head on assault or if no one else is around.
Always heal those who are injured, and even heal those who are uninjured as well (buff up their health up to 150%) as if they get a kill while they are over-healed from your gun or kill as you are healing them then you get a point. Easiest points in the game. My highest ever round score has been with a medic just keeping everyone on my team buffed to 150%. Medic is absolutely vital on 2Fort as there are so few health-packs.
The team with the most medics almost always wins. A heavy+medic rush is almost unstoppable. If your team is failing, turn to medic class and buff everyone.
Soldier = Rocket jump out of danger and never underestimate splash damage. I repeat NEVER underestimate splash damage. So get behind a corner and AIM FOR THE GROUND WHERE THEY ARE STANDING. You can't miss the ground. Do NOT try to hit them directly with the rocket unless you are VERY good, aim near their feet. Elevated positions FTW.
Scout = never stop moving. ever. Also, you will be spending half your time inflicting a bit of damage then running away to get a health pack, there is no shame in running away.
Pyro = Don't just run forward and flame... run up to them then strafe and flame, far more effective. Also, you are NOT an assault class (though technically you are) stay at your base and be defensive, use your alt fire to blast enemies back, and flame EVERYONE on your team as a "spy checker" enemy spies who disguise as your side will catch fire, there is no friendly fire in TF2, also if you can't walk through a team-mate, then they are an enemy spy gusguised as on of your team, same if they have the same name as you.
Overall, stick yo your engie like glue
Heavy = don't leave your base without a medic, you will get murdered as everyone will shoot at you and you can't dodge crap. 300hp will get whittled away so quick it won't even be funy. Till you find a medic, find a health + ammo spawn point and plant your ass there as an improvised sentry gun.
Demoman = hardest class yet also considered by the many to be the most over-powered. For beginners, spam grenades in general enemy location and coat defending positions (like CPs) with sticky bombs.
As a side not, grenades will only detonate on contact with the enemy if they DON'T first bounce off a surface. You should also get learning to "airburst" stickies. Stickies are also sometimes called "pipes" as in pipe bombs as they are effectively pipe bombs that stick to any surface.
Spy = for experienced players only. But if your team is being dominated it is a good time to learn. Very subtle class, depends on you knowing how all the other classes work VERY well.
Sniper = another subtle class, better suited if you have learnt how the other classes move to predict their movements.
Engineer = For a noob, my suggestion is to find another engineer (an experienced one) on your team and help him in building everything they make, two engies hammering on the same structure builds/upgrades it at twice the speed as a lone engineer. Also build a dispenser if you ever have any spare metal and UPGRADE IT TO LEVEL 3, when? AS SOON AS POSSIBLE. From then on as a noob I suggest you build a sentry gun where if will cover your friend's sentry gun, observe what they do and learn.
Listen to your team, if they want a teleporter, put it up. If they want a dispenser, it's probably a good idea.