It’s going to depend on the type of yarn and the type of dye used.
For an acrylic yarn, they are more or less colorfast… but if you leave it to soak in acidulated water it will bleed all over the white yarn you have soaking.
For wools, most commercially made wools should be more or less colorfast, but if it’s a hand-dye, it may not be. Acid dyes tend to be more colorfast than food-grade dyes.
Vegetable fibers like cotton are more prone to bleeding, and cotton/poly blends are the worst, IME.
Just always remember that reds are the most likely to bleed. That includes red blends, like orange and purple.
The best advice is to not soak. Wash it, but don’t leave it sitting in water, and it’s less likely to bleed. And if it’s in question, wash it by itself.
I’ve tried the vinegar trick, and it didn’t work for me.