How does this work in XMR?
It doesn't matter in XMR, because nobody knows, which coins are moved, and which are not. See also:
https://www.getmonero.org/resources/moneropedia/ringsignatures.htmlTechnically, it can be implemented, so you can decide to use this coin, and not use that coin. But practically, if nobody knows, which coins you picked, then it really doesn't matter. And because probably nobody needed it, then probably also nobody coded it, even if it is possible to make that feature.
And of course, you can reach that feature "manually", by importing to your wallet only private keys to the coins you want to use, and always sending everything. Then, it is guaranteed, that the coins you want to pick, will be picked, while everything else will stay untouched. But obviously, it wouldn't work, if you just reuse the same key.