Every hero has a role to fulfill in this game, and if anyone fails to do it, your team will have a bad time. Now the main important roles are carry, support, mid, and ganker. The ganker goes in a gang and kills and harasses the opponents, the mid plays on the middle lane alone and levels up fast and helps his other lanes when he gets an opportunity (TP scrolls are important for him, and a very stressful yet fun role to play in my opinion), the carry is very weak early game so he needs help staying alive but after enough farm, he can wreak havoc on the enemy, its also the hardest role to play because of a difficult early game. Lastly the support, he buys wards, the courier, and keeps his team alive through healing or sacrificing himself so the team can run away. Also its the easiest role to play, good for starters.
The usual format for a normal match in medium skill games are 2 supports, 1 mid, a ganker and a carry. And where the 2 supports make a baby sitting lane for the carry (so 3 on one lane), the ganker goes alone, and so does the mid. But remember adapting is critical, and in many games going 2:1:2 is better. When you pick a hero you see a small icon next to him in the hero selection screen, look at it, it tells you your role. Is it only for reference though, its very easy to switch roles with the right items and some creativity. Make sure you know what you are getting into, if you picked support, you are expected to ward, if you picked a carry, you are expected to dominate your enemies after a certain point, and so on. Also, you should know that picking a ranged hero is almost always easier than going melee. Since I mentioned hero selection, you should know what to skill first. Always, and I mean always level up a stun or slow. That’s like a rule, you need to stun your opponent so you can escape or kill him, depending on situation, but always useful. And for starting items, shield, tangoes, clarities are the way to go. The purpose of the early game is to stay alive. Also never ever buy a bottle unless you are playing mid (there are a lot of exceptions for the mid player, I can make an entire list for them).