How do you handle a double barrel name in citations/publishing?
Unfortunately, a lot of journals are not very friendly to formats that don't match the standard of: First, (Middle,) Last. It's gotten a lot better, but many systems expect one capital letter per name (so O'Brien is out).
Of course, always make sure you (or the corresponding author) enter your name correctly, so that the citation and metadata generated by the journal are correct. However, not all journals do that, or make it easily available. You can make a point of mentioning it in talks, etc., but that is slow to disseminate.
Besides that, you have two main options, in my opinion.
Hyphenate them. You can use a different name in publications than you do in real life.
Use a middle initial, e.g. "Sasha L. Baron Cohen." This implies that everything after the middle initial is one unit, whereas "S. Baron Cohen" would imply "Baron" is your usual first name, and "Cohen" your last.
If you see people (like in a tweet) or journalists - or ArXiV submissions - writing about your articles, feel free to correct them (publicly or privately), but correcting citations in published articles isn't usually possible, unfortunately, which is a big headache for the trans community in particular.
Do not feel bad about standing up for your name. In fact, the more people stand up for their own names, the more people who feel like they cannot (because they are foreign, or trans, etc.) will be able to.
Azor Ahai's answer is correct. The only way people... collaborators, publishers, etc. can know is if you tell them. My own example of the difficulty publishers and others face is in the names Frank Lloyd Wright and David Lloyd George.
I would normally have made this a comment, but I want to mention a possible way to help mitigate the problem, the International Standard Name Identifier, or ISNI. You can read about it here: https://isni.org/ You can also find the registrar for your country there. In the United States, it's Numerical Gurus: https://numericalgurus.com/isni-individual-registration/ and registration in the U.S. costs $25.
I have the opposite problem from Baron Cohen, a very common name. I've begun to attach this URL to things that might be published: https://isni.org/isni/0000000491573348
There is also ORCID, https://en.wikipedia.org/wiki/ORCID, with which I am less familiar. I understand they coordinate with the ISNI registrars and use a reserved block of ISNI numbers.