Here you should find some detailed info on roles and how to use them. Smogon also has a Pokemon dictionary that is helpful for introducing you to the metagame.
In a good team, it is a good idea to balance out types according to the coverage of your team, sometimes referred to as synergy. A team should not be aimed directly at sweeping; tanks, walls, stallers and others can be as efficient as they are. Often on a team hazard setters are introduced as leads or on weather teams a Pokemon that can induce weather as an ability. After that, sweepers should be considered. Most sweepers are aimed at one attacking stat, though occasionally can go mixed. Basically they are fast, hit hard and go for the OHKOs. After that, depending on your Pokemon's weaknesses, add a Pokemon or two that resists those types and has a decent defensive stat/HP to he able to wall or stall of an opponent with combos such as Protect + Toxic. It's often a good idea to add a 'tank'. Pokemon that are made into tanks often focus on Defence, but have a slight offensive niche that can allow them to take a hit and respond with a hopeful 2 or 3 HKO. On some gimmicky teams, sometimes you will see Pokemon that support the team by Baton Passing stat increases or passing status problems or entry hazards on the opponent. So basically balance out the types, use various roles and tactics will lead to a successful team.