AT infantry:
Taking out a tank as AT does take some skill, as your missile leaves a huge smoke trail.
First off, it takes 3 shots directly in the side or rear to destroy a tank, 2 shots on the front or rear of the tracks will get the tank too.
With AT missiles being guidable you can take out tanks at long ranges, though a tank will get a lock tone and dodge or pop smoke, the best range are medium to short range.
The tank will only get a lock tone if you use the zoom on the AT missile, if you simply fire it without zooming or guiding, the tank will NOT get a lock tone. Firing without the zoom is easy itself, you fire it like any other weapon, like the Bazooka from BF1942, so at short range simply aim at the tank and fire away.
To stay alive you must never stay in the same spot twice unless you are high up a building, you will get killed if you stay as the guy in the tank will not only know where the missiles probably came from, he will also know where it did NOT come from and will thus not look there a second time.
Fire your missile and run for cover!
Should you find yourself low on missiles, aim for the tracks or the rear as it does the most damage, even without missiles the tank will still get a constant lock tone if you keep the zoom on the tank, which is distraction enough already and might let your teammate C4 the armor.
Getting a tank from atop a building or crane is by far the safest, as long as the tank isnt too far away, the further away that tank is, the higher it can fire.