Role

In Dota 2, roles define the way a Hero can be played given their Attributes, Skills, and player. Different Heroes are suited for different roles and can be played different ways based on the player and situation. It is important to have a variety of roles in a team in order to increase the tactics at your disposal. There are three major roles: Carry, Support, and Ganker. There are many lesser, more subtle roles. The central ones are: Pusher, Tank, Jungler, and Initiator.

Major Roles
Major Hero roles are roles that are usually always chosen on a team. Without them a team is very unbalanced and is usually lacking in the missing subject.

Carry
Carries are Heroes that "carry" the team to victory. They are highly dependent on Items in order to be successful. Usually, they start out weak, but become a lot stronger later in the game. A carry hero depends on certain skills and Items to reach their maximum potential. Having too many Carries will cause competition within your team for resources, which might result in a loss. It is recommended that a team have only one or two Carry Heroes.
 * Examples of Carries include Anti-Mage,  Sniper,  Spectre and  Drow Ranger.

Semi-Carry
Semi-Carry heroes are the utility heroes. They are the all-around heroes which can play support while semi-carrying the team. These heroes are also dependent on items but not that highly dependent like the carry heroes. They usually get items like Mekansm, Force Staff, Pipe of Insight, Drum of Endurance and so on. Semi-Carry heroes only needs a core item or two to be effective like Aghanim's Scepter and Scythe of Vyse but usually what they get first are items mentioned above depending on the hero. These heroes have skills to help a hero get a kill and they can also get a kill by themselves. They are like support heroes if given the opportunity to farm can carry the game
 * Example of Semi-Carries include Windrunner,  Necrolyte,  Tinker,  Invoker.

Support
Supports are Heroes that assist other Heroes by keeping their allies alive and giving them opportunities to earn more Gold and Experience. Supports will usually come with Skills such as healing spells or skills that Disable enemies in order to prevent them from attacking friendly Heroes, or make them an easy target. Support Heroes are not dependent on Items  to be successful, and because of this much of their gold will be spent on items such as  Smoke of Deceit, Animal Courier, Observer Ward, and Sentry Ward.
 * Examples of Supports include Lich,  Dazzle,  Crystal Maiden and  Chen.

Ganker
Gankers are Heroes that specialize in taking out enemy Heroes quickly. They stop enemy Carries from farming properly and harass other Heroes in order to prevent the enemy team from getting the levels, skills, and items they need. While Support Heroes might focus on defending their teammates or rendering enemies useless, Gankers will usually play in a more offensive manner, such as getting early game kills to hinder enemy's progress.
 * Examples of Gankers include Vengeful Spirit,  Zeus,  Nature's Prophet  Batrider and  Night Stalker.

Minor Roles
Minor Hero roles are roles that come second-hand to the major roles, and if none of them are picked it does not affect the game as much as if a major role is missing.

Initiator
Initiators are Heroes that that are built for team fights. These heroes usually have skills that affect enemy Heroes in a large area which is useful in a team-fight. They typically engage enemies first, disabling the enemy team and tanking damage while the rest of the team follows up. They specialize in initiating and winning teamfights.
 * Examples of Initiators include Tidehunter,  Earthshaker,  Axe,  Puck and  Clockwerk.

Pusher
Pushers are Heroes that that concentrate on building up creep waves and taking down towers. Their goal is to put pressure on the enemy team, forcing them away from farming for income and finishing the game before the enemy Carry can become unstoppable. Pushers typically have skills that fortify allied creep waves, summon minions, or decimate enemy creep waves.
 * Examples of Pushers include Leshrac,  Chen,  Shadow Shaman and  Venomancer

Jungler
Junglers are Heroes that jungle neutrals at the start of the game, rather than lane. This allows for there to be two solo lanes, allowing the two solo lanes (Usually carries/support) to gain more experience. Junglers typically have skills that allow them to convert neutral creeps, summon minions, or decimate enemies. Make sure the other solo hero can handle the solo lane, one of the biggest advantages of a jungler is more team xp but if your solo lane has a hard time maybe you are not getting a lead or possibly falling behind.
 * Examples of Junglers include Nature's Prophet,  Axe,  Lycanthrope and  Enigma.

Tank
Tanks are Heroes that concentrate on having all focus on them. These heroes usually have insane amounts of HP, HP regeneration, and armor and can take high amounts of damage and still live. Their goal is to have everyone's attention while the DPS kill everything in sight.
 * Examples of Tanks include Centaur Warchief, Pudge,  Axe and  Medusa.