B vitamins - good for stress - why & how?

I keep hearing that B vitamins (B6 and B12) are good for people who are stressed.

How do the vitamins help? Do they actually help alleviate stress, or do they just help one’s body cope with the physical effects of stress.

For example - when I get stressed, I don’t sleep well and I get a lot of tummy problems.

So, if I took B vitamins, would I sleep better and have a more settled stomach? Or would the vitamins actually help me deal better with stress itself?

Thanks,
S.