Try offline practice for a little bit and then get to the real game.
Being a medic is a good way to start the game. You don't get much combat, but you'll see the map and how people play.
Soldier is also another good starter class. In time you will learn about rocket jumping, which is important.
As an engineer, think about the placement of your buildings and watch out for spies.
As a pyro, try to be sneaky on the enemies and always extinguish burning teammates.
As a demoman, make traps with sticky bombs and your grenades can be use to get enemies and engi buildings that you can't see like around corners. Use the environment to your advantage to deter, corner, or surprise enemies