The Yami Yami no Mi is one of the strongest Devil Fruits to exist in the world of One Piece. Eaten by Blackbeard, this Devil Fruit is known to be incredibly dangerous. Despite being a Logia type, it does not offer the power of intangibility to its user.
While that may seem counterproductive at first, it becomes immediately clear how overpowered the fruit actually is when one considers the fact that the user of this Devil Fruit can negate the powers of other Devil Fruits. In fact, this Devil Fruit can also suck up nearly anything in existence, making it truly dangerous. As such, only a few ways exist to combat Blackbeard.
5 Scientific Technology
Scientific technology is one of the greatest powers in the One Piece world. The core of this power lies in the technological advancements created by none other than Dr. Vegapunk. Together with the members of the MADS, he managed to get his hands on the Lineage Factor of living beings, which, in essence, is the DNA in the One Piece world.
With this Lineage Factor, Vegapunk has been able to create incredibly powerful beasts that have been seen all over the story. The Pacifista were introduced to the fans shortly before the Summit War. After the 2-year timeskip, the fans were also introduced to the Seraphim, who are known to be the strongest humans to ever live. These Seraphim are the pinnacle of power in more ways than one and, on Amazon Lily, Mihawk's Seraphim managed to take on Blackbeard and fared quite well. As such, they are an effective counter to the power of the Yami Yami no Mi.
4 Haki
Haki is an incredible power that fans were introduced to very early in the series. However, it wasn't until much later in the story that a proper explanation about it was given to the fans. Haki is found within every living being in the One Piece world. However, very few can actually make use of it in combat. As such, only a select few can be considered worthy of countering Blackbeard with this ability.
Even among those who have awakened this power, only those who have advanced it to a significant degree standard chance against the Yonko. That said, from what fans have seen far, Haki would be an efficient counter to Blackbeard's Yami Yami no Mi.
3 Fishman Karate
Fishman Karate is a fighting style that is mostly common among the Fish Men and the Merfolk of the One Piece world, although everyone can learn it. This style of fighting revolves around the usage of the moisture present in the user's surroundings and in the bodies of the enemies.
As such, Fishman Karate does not need the user to get up close and personal with their opponent. A master of Fishman Karate can launch attacks on Blackbeard from a significant distance and be safe from the powers of the Yami Yami no Mi. That said, by itself, Fishman Karate is not strong enough to combat Blackbeard. Amplification with Haki, however, makes it strong enough to take on the current Yonko in combat. Only Yonko level users of this ability would stand a chance against him.
2 Select Few Devil Fruits
While Devil Fruits are counterintuitive to use against Yonko Blackbeard, there are some fruits that would work effectively, given an opportunity. These are fruits that only require a single hit to defeat the opponent and, while rare, they certainly do exist in the world of One Piece. The powerful ability of the Empress of Amazon Lily, Boa Hancock, is one such Devil Fruit.
With her ability to petrify enemies, the Yami Yami no Mi can effectively be countered. Another Devil Fruit that would prove to be very useful against the Yami Yami no Mi would be Sugar's Hobi Hobi no Mi, or Trafalgar Law's Ope Ope no Mi. Devil Fruits that can finish off the enemy in a single attack are certainly a perfect counter to Blackbeard's ability. A demonstration of this was given to the fans during the Impel Down arc, where Blackbeard was confronted by Magellan and was defeated in a single blow, thanks to the poison abilities of the Doku Doku no Mi.
1 Lunarian Power
Another incredible ability that can effectively counter Blackbeard's fruit is the power of the Lunarian race. The Lunarians were recently introduced in One Piece during the Wano Country arc. There, it was revealed to the fans that there once existed a race of mighty powerful individuals who lived adopt the red line and were considered to be the Gods of the world.
These people had brown skin, white hair, and black wings on their backs with a giant flame directly behind their heads. The power of this race was such that they could manipulate and use flames at will. At the same time, they had the ability to survive under extreme conditions, as long as the flame on their back was lit. King the Wildfire, one of the All-Stars of Kaido, is a member of this race. As long as the flame on their back is burning, no ability can pierce their ultimate defense. Having the powers of the Lunarian race can certainly aid a user against the power of the Yami Yami no Mi.