Well first things first. remember that riflemen, berserkers, archers, etc. have medium armor, they have this for a reason, to make themselves less vulnerable to piercing and magic, which are the 2 most common types of attacks of flying units
However basic infantries all have heavy armor, which if you know wc3 then you know that it takes 200% damage from magic attacks, so how do you make a basic infantry unit that can function against both ground and air???
The Answer:
Modify an night elf ability called Elune's grace to reduce damage from magic by 50% and you can also modify the damage taken from piercing attacks with this ability, change the ability, its icon, etc. rename it and then give it to your soldier.
Give the soldier a 2nd attack where it launches a projectile at air units, look at how its done with heroes, the 2nd attack is a launch of a projectile, I can't explain this here but I'm sure there are tutorials, so please look into those
Then you have to balance out how much damage attack 1 does and how much damage attack 2 does as well as cooldowns for each.
Lastly how much hp the unit and how much food it'll cost (along with how much gold and lumber it will cost obviously)
I've tried a 400hp unit costing 2 food but it got spammed too much, try a 500-675hp unit with a food cost of 3 I think that should balance things out, you could even go for a stronger unit, just increase the food cost, the rest is up to you