This question is really broad, but I'll try my best to give a satisfactory answer.
I recommend is watching this video. You might not be ready for the terminology used in it, but it'll still give you an idea of how to make a team. The guy who made it has a lot of experience in the game and runs a great YouTube channel, which might also help you get better at competitive Pokemon. If you're interested, watch some of his live Pokemon Showdown videos. He does great commentary and explains why he uses the moves he does in battles.
If you're wondering what program he was using in the video, it's called Pokemon Showdown, and it's something you should definitely try out if you're interested in competitive battling. It lets you play competitive battles online in your browser, without the hassle of breeding teams and such. Everything is right there, available for you to use. Note, it also uses Smogon.com's Pokemon tier system, something you should also know about if you don't already. You've probably seen people refer to things like "OU", "UU" or "Ubers" before; Smogon's tiers are what they're referring to most of the time (other tier lists are incredibly obscure). You can ignore all of this if you just want to play in normal Wifi battles in your game, but just keep in mind that a vast majority of competitive battlers use Showdown for its accessibility and skilled opponents that Wifi doesn't offer.
Finally, one last off-topic thing that might help you get into things: this answer here. This will link you to a bunch of useful resources that'll help you get into competitive battling. If you read anything from the list of things there, make sure it's this. This will explain a ton of foreign terminology and give you some prior knowledge for when you go into battles.
Alright, now I'll try to answer your actual question! Mostly, it comes down to one thing, which is: a balanced team should consist of Pokemon that support each other by beating the Pokemon that their teammates are weak to. That sounds incredibly simple - and it is - but that's really what it's all about. Some more specific things that'll better address your questions:
- When thinking about what Pokemon or types you need to beat, think more about certain Pokemon specifically, not just a certain type. You could have three Pokemon that resist every type in the game, but still be weak to a combination of two or three types. For example, I could have three Pokemon that resist Fire and three Pokemon that resist Dragon on my team and think, "Mega Charizard X can't beat me now". That isn't true in the slightest. What if my Fire resistant Pokemon don't resist Dragon or vice versa? What if they're weak to Charizard's other moves? You could say that Flash Fire Heatran checks Mega Charizard X because it resists both Fire and Dragon. That's not true either, because it often uses Earthquake, which removes Heatran as a potential check to Mega Charizard X. That all sounds like simple stuff, but it's a common mistake people make when they're new to competitive Pokemon.
- On countering specific Pokemon, when building teams, consider which Pokemon are the most prominent or threatening in the tier or metagame that you're playing. For example, Landorus-T is a popular Pokemon in OU, so you should think about having a Pokemon on your team that can beat it. However, you should worry less about Jumpluff in OU, because it is an extremely unpopular choice that you will almost never see in that tier. This ties back to the main idea of having Pokemon that beat each other's weaknesses. If several Pokemon on your team get KO'd by Landorus-T (or perhaps get walled by it), it should be of your concern to include a Pokemon that can effectively beat the Landrous-T variant that beats your team, especially considering its popularity.
- I'm not sure what you mean by "one type teams" and "mixed type teams", but unless you're playing a special game mode called Monotype, try to have type diversity in your team, both offensively and defensively. This isn't a concrete rule; things like dual-typed Pokemon and abilities can mean that a team with three Steel-type Pokemon can still be "balanced", so long as they don't all share a common weakness that the rest of your team can't beat.
- Here's an important one: no, you do not need to have a tank, sweeper and wall on every team for it to be effective. The same goes for other roles; your team isn't instantly bad because it has no cleric, hazard setter, support Pokemon, revenge killer, whatever. Different types of teams use different sets of Pokemon with different "roles". I'll introduce you to some popular examples.
- Balance, which is what it sounds like. It's a balanced team with a series of Pokemon that fulfil different roles. Often these are the most well-rounded teams, as they're versatile and have a Pokemon for different roles. However, these can be taken advantage of. For example, if all a team's attacking Pokemon are taken down or weakened, all that's left is a set of passive support Pokemon that are essentially setup fodder if they have no offensive presence, or can't threaten your team otherwise.
- Hyper offence or just "HO". These go by the "offence is the best defence" concept, and often use a series of powerful attackers that win by weakening the opponent's team with their powerful attacks. These teams often have setup sweepers, revenge killers and other Pokemon that can function as a "win condition", which is basically a Pokemon that can clean up a game once their counters are weakened or KO'd. Players who use HO team can identify a Pokemon on their team that can win once x Pokemon go down or are weakened, and then use that Pokemon to win the game. Similar strategies can be used with balance, but balance involves a lot more switching and defensive play. HO teams are often weak defensively, and can often lose if a strong attacker gets an opportunity to set up.
- Stall, a type that's often either very good or very bad depending on which tier or metagame you're playing. This has a defensive playstyle, and aims to cripple the opponent's team with status effects and by making it difficult for the opponent to deal significant damage or KO any Pokemon. Once the player using the stall team has control of the game, they can continue to gradually wear down the opponent's team until they win. Some stall teams use some sweepers in the back who can clean up when they get an opportunity.
Alright well this ended being way longer than I thought it'd be. If you have any more questions, leave a comment and I'll try to add something to my answer that'll help you out.