As you may know, the ender dragon every now and then comes to the mid of the portal to do something I never really knew.
(basically the ender dragon doesn't do what the pic is showing and i can't hit him with my sword)
However I've stopped playing Minecraft for some years, and I've came back around 5 months ago, and I wanted to do the classic vanilla Minecraft survival run, but I can't keep going because I can't kill the ender dragon, since I run out of arrows before I even kill him.
When the dragon lands on the portal it's immune to arrows. You either need to wait for it to take off again, or run in and whack her with a sword or axe to continue the fight. I found that running in from the rear at an angle can get me underneath where I can do major damage with an enchanted sword or axe, and as a bonus, any endermen I agro'd get killed by the dragon when they try to attack me while I'm under there.
And most important, you need to destroy all the ender crystals on the towers! They heal the dragon, usually faster than you can damage her, so it's MUCH harder to kill the dragon with any crystals still in operation. Shooting them with arrows is the fastest way (except for the ones in iron bar cages).
The dragon was never all that hard to kill, and the new landing on the portal mechanic makes it even easier. After you take out the crystals on the towers you can kill the dragon pretty quickly without even using a bow (although shooting the dragon while its flying certainly helps).
Bring a stack or two of bottles to quickly collect the lingering dragon's breath and remove it as a threat. Potions of strength and healing or regeneration, as well as a golden apples can help you do more damage and survive. Bring blocks to climb towers to get at the crystals in cages, and water to quicky jump down and also to keep angry endermen at bay.
Wearing a carved pumpkin on your head prevents the endermen from going argo, even when you stare right at them, however, the pumpkin replaces your helmet so you have less armor protection and less visibility (night vision helps keep track of the dragon).
God level armor helps you survive, but you run the risk of losing it if you fail, so it's up to you to judge the risk/reward potential. The dragon is way easier to kill than a wither, so if you've defeated a wither, you should not have much trouble with the dragon.
I fought the dragon 18 times recently to open all the outer end island portals. I was never able to hit it with my sword when it was hovering over the portal. I had to use arrows every time. Having an elytra and bow with infinity helped in that department.