Black blades have been a mystery for a long time in One Piece, and there are several theories on how they're made.
One Piece has been a part of Shonen Jump Magazine's weekly line-up since 1997, and has only just recently entered its final saga. Fans are eagerly waiting for the day that their burning questions about the unsolved mysteries in the story are finally answered. Some fans have been around since the earliest chapters.
At first, Yoru's color seemed to be a quirk of Mihawk's character design, but another black blade, Shusui, appeared in the Thriller Bark arc over four hundred chapters later. These are the only two black blades that have made appearances in the story.
While there aren't any concrete answers as to how black blades are made, the secret may lie in one of One Piece's power systems: Haki. There are three types of Haki: Observation, Armament, and Conqueror's. Armament Haki is described as invisible armor the user clads themselves in, used for both offense and defense. When used, the part of the body the user is infusing with Haki turns black. For weapon users, their weapons become black as well.
During a two-year time skip, Zoro trained under Mihawk to become stronger. Part of his training was to learn how to use Haki, and during this training, Mihawk told Zoro that with Haki, any blade can become a black blade like his.
Using Armament Haki does turn Zoro's blades black, but unlike Yoru, they do not stay this way. Fans have speculated that when a swordsman uses Armament Haki enough, their blades will permanently turn black, but this theory has some issues. If the requirement of using Armament Haki enough times was true, then King of the Pirates Gol D. Roger, who carried a cutlass, should have possessed a black blade, but he did not. This is where an important distinction is drawn: characters that fight with swords are not always swordsmen.
In One Piece, swordsmen are akin to real life samurai: tradition-based, honorable warriors. They have an innate respect for one another, and duels between swordsmen are acted out accordingly. In Zoro's most recent fight with King of the Beast Pirates, King fought using a sword, but would use other attacks like punches and kicks, something Zoro remarked on by saying King never claimed to be a swordsman.
Simply using a sword isn't enough to make oneself a swordsman, just like the use of Armament Haki isn't enough to create a black blade. How black blades are made must lie somewhere in between.
Shimotsuki Kozaburo, a legendary sword smith, told a young Zoro that blades possess their own personalities, and that they like to test their wielders. If the wielder lacks the necessary strength or conviction to wield the blade, the blade will in turn become unruly.
Zoro has carried a cursed blade, Sandai Kitetsu, for almost the entirety of the story. In the Kitetsu's case, it often cut much more than the wielder intended, leading people to believe it was cursed. Zoro put the blade to the test before he purchased it by throwing it into the air and seeing if his luck could overcome its problematic nature. Zoro prevailed, and has carried the sword ever since without issue. This proves that blades have something of a sentience to them, and that they can be satisfied with their wielder, so that they are no longer problematic.
Combining everything, there is a possibility that black blades are formed when a swordsman, who has devoted himself entirely to the practice of swordsmanship, has fully mastered and been accepted by their blade, combined with the usage of Haki. Acceptance and mastery over a blade, much like the usage of Armament Haki, could still be an arbitrary requirement, so it is difficult to say exactly what either of those things look like.
If the fans are correct, it could be what leads to the first time a sword is shown becoming a permanent black blade.