You battle them. The first gym depends on your starter Pokemon so you need a super effective Pokemon.
unova
You have to beat certain gyms.
you have to beat the gyms in the area.
when you beat the gyms you get badges that let you use hm moves in the field and stronger Pokemon will obey you.
......8........how do you not know that......
He has beaten all of the Kanto gyms, Johto gyms, Hoenn gyms, Sinnoh gyms, Battle Frontier, Orange League, and four Unova badge. So he currently has 47 badges!
Beat the 8 gyms.
train them en beat gyms for the league
you keep on battling the gyms
beat 7 gyms
Beat the elite 4 for the first time.
You have to beat the main storyline and possibly complete the Unova Pokedex.