As I said earlier, the best way to do this is to try to have as many partners as possible to apply the same sanctions regime, or to try to influence those who don't apply sanctions so that, at the very least, they aren't participating in the sanctioned country's war effort.
In the case of Russia, as I was saying, China is currently walking a very fine line of neutrality. It isn't participating directly in the war effort. It isn't selling weapons, nor is it selling parts needed to repair or produce tanks or warplanes. However, it's helping Russia by signing economic agreements. Russia has had to replace the European market and, since then, China has become its leading economic partner.
So there's no right answer to getting around black knights. The more countries that apply the same sanctions regime, the more effective the sanctions will be and the greater an impact they'll have. Sanctions don't stop wars, but they have an impact, and it's important to have means in place to measure those effects.