Tanks in Battlefield V can only carry a limited amount of ammunition. When you run out, you need to get more. Just like if you run out of ammo when playing as a soldier on the ground, you need to pick up some ammunition to keep fighting. With tank ammunition it isn’t quite clear what you’re supposed to do when you run out of ammo, but you’re definitely not just supposed to abandon a perfectly good tank.
What you need to do to get ammo for tanks is look for an ammo supply area. These will be boxes with a white gear icon on them. Just drive near them and once you get close you will see a small prompt on the bottom of the screen that says resupply with the LB/L1 button.
Hit that button and it will add 10 tank shells at a time into your inventory and then you can get back onto the battlefield with a fresh batch of ammo.
As far as planes go, they also have a resupply feature but it’s a little less realistic. On both sides of the map there are three boxes. Simply fly over these boxes and press the LB button and you can resupply bombs for your plane.