I was running White Plume Mountain for a group as a one shot. (5e, out of Tales from the Yawning Portal.) With the group starting at 8th level, I let them pick an uncommon magic item. Our Goliath Barb/Warlock chose a Ring of Mind Shielding. Then he got Blackrazor. Here are the relevant sections of the item descriptions:
Ring of Mind Shielding
If you die while wearing the ring, your soul enters it, unless it already houses a soul. You can remain in the ring or depart for the afterlife. As long as your soul is in the ring, you can telepathically communicate with any creature wearing it. A wearer can't prevent this telepathic Communication.
When it devours a soul, Blackrazor grants you temporary hit points equal to the slain creature’s hit point maximum. These hit points fade after 24 hours. As long as these temporary hit points last and you keep Blackrazor in hand, you have advantage on attack rolls, saving throws, and ability checks.
If you hit an undead with this weapon, you take 1d10 necrotic damage and the target regains 1d10 hit points. If this necrotic damage reduces you to 0 hit points, Blackrazor devours your soul.
If you die from the necrotic damage from the sword as described, which item gets the soul? (I ruled a tie goes to the item that you have had the longest.)
Blackrazor wins ... probably
Since being reduced to 0 hit points doesn't usually kill you, then Blackrazor would devour your soul.
PHB, p. 197:
It is unlikely, but technically possible that the necrotic damage from Blackrazor could instantly kill a character. I can think of a few conditions that might make this more likely:
In any case, the key part of the rules regarding dropping to 0 hit points is:
So, do you drop to 0 hit points, and then die? Does Blackrazor swallow your soul?
Your DM will have to resolve this question. To the best of my knowledge, this is not explicitly outlined in the rules, nor has it been officially answered.
For guidance, your DM might consider this answer found on page 13 or the Sage Advice compendium:
The Relentless Endurance racial feature, PHB p. 41:
It is possible that this Sage Advice ruling indicates that even though Relentless Endurance would put you back to 1 HP, the effect of Disintegrate, triggered by being reduced to 0 hit points, is still resolved.
That would imply that, when a character is reduced to 0 hit points, you resolve all of the effects that would happen as a result. In our case, one of those is instant death, and one is from Blackrazor. After resolving both conditions, the character is dead, and his/her soul has been swallowed by Blackrazor.
The effect of the ring cannot not be resolved until after the character is dead. At that point Blackrazor has already swallowed his/her soul.
But in the absence of explicit rules or an official answer, the decision ultimately rests with the DM.