They have different roles.
Helicopters are generally used in the anti-tank role while tanks are used to provide heavy support to infantry on the ground.
Of course, tanks can also be equipped with AT munitions, and helicopters can use anti-personnel munitions and ASMs, but you have to keep in mind the cost-effectiveness. In any army, it is important to have versatility (the ability to use a variety of weapon systems to achieve tasks) and flexibility (the ability of different weapon systems to be used in different scenarios).
P.S. I am talking in the context of a war against Pakistan on the plains of Punjab or the deserts of Rajasthan/Sindh. In mountainous areas like Kashmir, etc., helicopters are used differently and tanks are not used.