meta compositions:
There are two 'meta' types (i.e. ones that see play in professional teams), which translates as "we must do this to win" in the minds of a lot of silly players.
One is two tanks, to damage dealers, two healers - it's a balanced team that works well. The exact choice of which characters is variable, and in theory should depend on the enemy, map etc but in most cases reinhardt + anyone is a good tank pick, lucio + one of ana, mercy or zen is a good healer pick, and the 'best' DPS are mcree, soldier 76, pharah.
The other is three tanks, two healers (including ana) and one pure damage dealer (usually soldier 76).
The reason people outside of 'pro' teams like to see these patterns is because they know it can work and trust it. In reality, there's a lot more to it.
'counters':
Some characters just work better against others (in a rock paper scissors way). Rather than look up a list, try this: When you're playing a given character think, "who keeps killing me"? That's a good person to pick to counter that character when the enemy team have one.
what to pick:
What rank are you in competitive, if you've got that far?
My opinion would be, if it's below ~2000, you just need at least one healer and at least one tank, everyone else can just play whatever they are best at. Above that, ask the team what they need (and be prepared to heal 80% of games).
In quick play or arcade: Whatever sounds fun.