Another thing to consider is how similar the languages are. French and Spanish are very similar, so prior knowledge of one Romance language helps you pick up a second Romance language more easily, but confusion will be more at first. Not to mention differences in gender of some nouns. On the other hand, the sound/pronunciation is very different between the two. Hearing a French person speaking, you would never think it was Spanish, and vice-versa.
One helpful strategy is to correlate the language with specific people who speak it. Train yourself so that when you face a certain person who speaks French, the only language that will come out is French. This can work so well that even if that French-speaking person asks you to say something to them in another language, like, say, Spanish or even English, you simply can’t do it. This used to work really well for me; not sure why it doesn’t any more. Maybe because I’m now in an environment where I’m constantly switching between languages and sometimes I even forget which language a certain person speaks. Yes, it is embarrassing to face a close friend and suddenly go blank. I think to myself, “If only I could think of one word, just one word.” It really does take a moment to “code-switch.” Lately, I found I can scroll mentally through all the first-person singular pronouns until I get the right language, and then, after the first bumbling sentence or two, it’s usually ok.
Want to hear a funny story? A Spanish-speaking friend asked me, “Is there a guitar I could play?” I right away pointed to the guitar and said emphatically, “Yo!” <–that means, basically, “Yes, there is one!” in Mandarin. But my friend thought I meant, “I will play the guitar, not you.” because “Yo” happens to mean “I” in Spanish. Oops! So… it happens.
I’ve seen YouTubers advise that we take on a different personality for each new language. So that’s an idea. So maybe when practicing Spanish you could think of some Spanish-speaking role model, and try to imitate that person’s accent and mannerisms whenever you’re speaking Spanish, and switch to a different (French-speaking) role model to emulate when speaking French. Or use a different voice (high pitched versus low pitched, nasal versus breathy, or some other way to differentiate.) I haven’t tried this yet, but I think it’s worth a shot.
Or if you are studying more than one language at once, you can consider doing them in different locations. Practice French in the kitchen? Spanish in the living room? etc. Or French in the library, Spanish at the gym. And/or use different methods. Listen to a Spanish playlist of something interesting while exercising; sit down and read the mini stories in French. I’m not sure it’s really great to use the exact same stories for multiple languages, even though I do it sometimes.
Another strategy I’ve tried a little but have not done exhaustively, is to form associations between a newer language (L3) and a more familiar language (L2), forming a bridge. So for example, amigo=ami, or¿dónde está mi sombrero? = où est mon chapeau? Then if L2 pops into your head, L3 is also right there.