Killing the Wither is a brutal fight, keep that in mind.
I want to point out two "set-ups" that dont work here: trapping the Wither in bedrock in the nether and the end.
If you try to trap the Wither in the nether's ceiling, in the best case he will just get stuck in the first half of the fight. As soon as you take him into the second half, he will go straight down destroying anything in his path without warning. You can't fight in the nether. Same case, if you put him below the end portal and try to "drown him", he will just move away and attack both you and the enderman. While you can fight here, you risk of letting the nether star fall into the void.
Just as Legendary J Man says, the best place to take him down is in the overworld, inside a cave.
What I did was to use a really, really big cave I made long ago. I dont know how big it is, but you could easily sprint 20 to 25 seconds from one wall to another. I didn't wanted to use it, but this was the easiest place to fight against the Wither. I used an enchanted bow (Power III and Infinity) an enchanted sword (Smite I), enchanted armor (mostly iron, but since the wither effect ignores armor, I didn't craft a full set and ended up using a golden helmet and a leather chest piece) and a potion that maked me inmune to fire and lava.
As soon as he appears, if you are away from him, he will start making his way up. If you want to stay alive, I recommend using a regeneration potion and maybe a golden apple. I just attacked him with arrows until he reached half HP and covered himself with armor and summoned three wither skeletons (that I just ignored).
In the second half, he charges at you and destroys any block in his way. What I did was to wait until he charged at me, tried to dodge it (the move is fast, and it made my game lag due to all the blocks being destroyed) and run below him to wack it with my sword. He can´t shoot skulls nor charge at you straight down, so this is the best place.
Once he is defeated, he will be stuck in place for a bit and explode. Run away so you won't die with him.
If near him is a source of lava when he explodes, try to cover it up (this is the reason why I used up the potion against fire and lava) so the nether star wont be destroyed by the lava. This happened to me.
Don't be stressed if you die. I died a lot in the second half.