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.