Ah Heimerdinger, adorable bastard, one of my favorites.
So, To be quick Heimerdinger is countered by two major things: AoE and Burst.
As a general rule, Heimer requires fights to be extended, bursting him down is a quick and easy way to stop this process, but knowing when you can and can't engage him to burst is critical in fighting against him. Like any champion you want to find or set up an opening in his defenses so you can rush through and take him out. Always be mindful however because Every moment that Heimer isn't dead is one more that you are taking likely a massive amount of damage. Make sure you take advantage of his pre-zhonya's laning, because after his gets this item bursting him becomes a much more difficult endeavor, especially if you need to get in close.
Early game, make SURE to down his turrets when you can, and do so SAFELY. This means prepare for counterattacks because if possible, a good Heimer will always punish you for attacking the turrets if able
Displacement of turrets a la
is of course an obvious counterinitiative to heimer, but assuming you aren't picking just for the sole benefit of annoying the little inventor (As a Heimer player i fight A LOT of syndra's, serious guys its kind of rediculous) , then you should focus on clearing turrets, roaming, or setting up for Fast kills on the inventor, keeping an escape plan in case he manages to prolong the fight as he is prone to do. Most mages have some form of AoE waveclear, and worst comes to worst, you can always farm up (Heimer's rockets stop on the first target hit so you can use minions to block his long range harassment)
If you have the ability, clear the turrets as often as you can, but once more only do so safely or you open yourself to harassment. If you have a jungler who lacks a gap closer such as Udyr, ensure Heimer's nest is either adequately disposed of, or that his Grenade is down if you want them to gank, (Heimer just loves melee champions who try to bum-rush him in his nest, Don't let him do that to you.) If you can't ensure that your jungler will be able to help you kill Heimer quickly, inform them not to gank, or try to set up the gank before they come in.
In short, Heimerdinger is a test of patience and trading knowledge. Keep your head about you and look for openings and you'll be fine. Rush in without a plan, or underestimate his strengths and you'll die.
and a PSA to anyone reading this PLEASE STOP SPAMMING SYNDRA We get it, she's a counter, stop making me fight her every goddamn time i pick Heimerdinger, i swear she's becoming my preferred matchup on him now dear lord.