Alright, we're just going to say off the bat that the title of this guide is a bit misleading, because there is no guaranteed way to beat the Nameless King. His attacks have a m>huge hit box, whilst the hit box around him is tiny given how erratically he moves in the later stages of the fight. We can help you prepare and tell you want to expect, but honestly, this fight mostly depends on how well you can learn his attack patterns and time your own movements accordingly. This guy is worse than Pontiff Sulyvahn and Aldrich put together. Luckily he's totally optional, so you don't actually have to do this one.
1. The Approach
To find the Nameless King's boss fight you need to start from the Great Belfry bonfire and run back along the corridor. On the right is a large bell, which is probably why this area is called the Great Belfry. In front of the bell is a lever; pulling it triggers a cutscene and a sudden storm. When the cutscene clears you're exactly where you were, but everything is rainy and windy and there are a lot of dark clouds in front of you. You can drop down and walk on these, under the bell and straight into the boss fog door (which does at least look like it fits in the surrounding aesthetic this time).
The Nameless King deals lightning damage, so anything that will increase your resistance to that is going to help you out. The Nameless King himself is weak to fire, but the King of Storms is resistant to it. Dark will also work fairly well. You'll also be moving a lot, so any buffs to stamina you can squeeze in are useful as well. If you're a melee build you can try a very strong shield, but be aware that his attacks will drain a huge amount of your stamina. A weapon with a longer reach will probably be helpful, especially in the early part of the fight, but don't go for anything too slow.
2. The Nameless King's first phase
When you start the fight the health bar says you're up against the King of Storms, which actually refers to the big bird thing the Nameless King is riding. For this first phase it's actually better to stay close to the King of Storms, since it's his ranged attacks that do the most damage and are harder to avoid.
In terms of attacks to avoid you should be looking out for the Nameless King charging his swordspear with lightning, which telegraphs his intention to chuck aforesaid lighting at you (relatively easy to avoid), and the King of Storms' firebreath. When he breathes fire at ground level it's actually a convenient time to get hits in. If he flies up slowly, using a couple of wing beats, and stays in an upright hovering position, he's about to breathe fire from above. In this instance you need to run in a straight line directly away from his head. The fire has a long range on it and will track after you, so dodging to the side or running towards him won't help. If you can, fight without the automatic lock on, because it will help you to keep tabs on what both the enemies are up to.
When you're able to attack you need to go in for the head and neck of the King of Storms. Doing enough damage to his head directly will stagger him, allowing you to get a nice riposte in. Being up close will leave you more vulnerable to the Nameless King whacking you with his swordspear but because it's a long weapon the angle is often too tight for him to get a proper hit in.
The first phase isn't too bad, and if that was all there was to the boss fight you'd be laughing.
But that's not all there is to the boss fight.
3. The Namless King's second phase
Once you've taken out the King of Storms you get an unskippable cutscene, and you're now facing the Nameless King himself. At this stage, if you're at range, he'll start using some attacks that send a wall of cloud at you. They have a large hitbox to them, so can be tough to avoid. In terms of his melee attacks you're looking at a lot of wide sweeps from either side and slams with his swordspear. He sweeps back and forth across the map a lot as well - think Iudex Gundyr, but way faster.
For this phase you just need to keep moving and get those hits in when you can. Buff your weapon for fire or dark damage or use pyromancies if they're part of your build. The most regular opening for attack you get is when the Nameless King leaps into the air and prepares his swordspear for a charge. Keep moving while he's up there and then, when he slams down towards you, roll under the attack, spin, and use his recovery period to attack. If he ever prepares to charge at you from the ground, with his swordspear at hip height, dodge back or to the side; rolling forwards will spear you right on the end of it.
You can get another brief opening after an attack combo he pulls: two horizontal swings of his swordspear, side to side, and then a forwards thrust with it, after which he pauses briefly. For ranged players keep your distance and run immediately sideways when you see him raising his swordspear for the ranged shockwave cloud attacks. Play cautiously to get your hits until you've worn him down to half health.
4. The Nameless King's third phase
Bonus final phase! For this phase the Nameless King will add some pretty devastating lightning attacks into his repertoire. For one he charges his swordspear with lightning and then raises it to the sky. This calls down lightning to wherever you're standing, so it's about getting your dodge timing down.The second new attack sees him call a bolt of lightning into his own hand, and then slam it into the ground. Back off when you see him telegraphing this, because it deals area of effect lightning damage. The final one is probably the worst: he'll charge his swordspear and then slam it into the ground in front of him, which is a big hit on its own, but a beat after it lands some residual lightning will blast out in lines from the point he hit. If in doubt, whenever his swordspear starts charging then back yourself up.
Aside from that he has the same open points as before. For melee players you can maintain more control over your stamina by rolling accurately and using the shield block only when you can see your roll won't outrange the attack. This puts you in a better position to attack quickly when you get the chance.
It sounds simple written down. But no messing. This fight is the worst. Just don't do it. Don't bother. Walk away. It's optional. You don't need to subject yourself to it.
Buy the official Dark Souls 3 Guide now.