The same way you get better at any thing else. Practice.
More specifically, there are a couple elements you need to get the hang of. The first is teambuilding. This is the easiest to teach but the toughest to master, imo. You should build a team which can deal with all the
common threats. It should also have a general plan on how to win as well. A lot of new players try their best to use bad pokemon in unique ways. Don't. Not to start. The reason commonly used pokemon are commonly used are because they are the best pokemon. Less used pokemon have their uses, but they are very niche, and its not worth using them until you get the hang of the metagame. There are plenty of places to find common sets for pokemon. Nintendo tracks the usage of any given item/move/teammate for any give pokemon, which they release
here. Smogon has some movesets for the 2014 season, as does Nugget bridge, but the 2015 metagame hasn't settled so things aren't cut and dry yet. It'll be easier to find specialized sets after the first batch of regionals in Feb.
The second thing is knowledge. You should know what any pokemon can do, and how to deal with it. Even if its not common. Again, Nintendo tracks the stats for all pokemon, so if you don't know what moves Hawlucha commonly runs, you can check there, so you have an idea of what to expect in battle.
Third is in-battle skill. This encompasses prediction. It also encompasses planning a few moves ahead. And knowing what end game you want. Lots of things. This is where practice is key. I feel like for this, watching really good players explain why they make moves is the best way to learn their analysis. Alex Ogoloza, Aaron Zheng, and Baz Anderson are three great players with VGC-based youtube channels and great analysis.
Also, don't be afraid to ask questions. Good luck!