how to beat the ender dragon? I keep dying

The best way to beat the Ender Dragon is to prepare yourself with the right equipment and strategy. Make sure you have a full set of diamond armor, a bow with plenty of arrows, and a few potions of strength and regeneration. You should also bring a few blocks of obsidian to build a platform to stand on while fighting the Ender Dragon. Once you have your equipment, you should try to hit the Ender Dragon with your bow from a distance, while avoiding its attacks. When it gets close, use your sword to hit it and then quickly move away. You should also use your potions to give yourself an edge in the fight. Finally, when the Ender Dragon is low on health, use your obsidian platform to get close and finish it off.