You must create a one-cycle platform in order to kill the Ender Dragon. This is basically placing a mattress on top of a bedrock column with two obsidian blocks beside it.
Place one bed on top and place the shrine at the end of the bedrock pillar. Place one bed on top of a bedrock pillar shrine at the end. Next, place two obsidian blocks on each side of the bed. This will ensure that the bed explodes without causing any damage to you. This video will show you how your once-cycle platform should look.
Once everything is set up, you’ll be able use the bed to kill Dragon. Make sure you have at most seven to eight beds. You might also need a few extra in case something goes wrong.
After you have all the necessary information, you will be able to kill the ender Dragon by using the beds to explode at the right moment. This will happen when the ender Dragon swoops over the bed. But to make sure you get the timing right, it is best to use it just before his head is about the fly over the bed.
Also, you will need to hit the middle of the dragon’s skull as it will suffer the most damage. You can accomplish this if the moment is right. However, if you are unsure, you can refer to the amazing guide by Josh the Squash, which will be linked above.