This should be a fairly easy question.
Actually, at its most general, comma placement has many different rules, quite a few matters of taste, and a few cases where one might make a conscious exception, so the most general "where does one use a comma?" is a pretty tricky one.
It's best to learn the various different uses separately.
Now, here we can answer it in one of three ways.
The first is to consider "But yeah" as serving as a single interjection on it's own, and punctuate accordingly:
But yeah, the astronauts made it safely into their spacecraft.
The second, is to consider the yeah as a parenthetical interjection. In other words it's the sentence "But the astronauts made it safely into their spacecraft" with "yeah" added in parenthetically:
But, yeah, the astronauts made it safely into their spacecraft.
Having two choices so far might seem more daunting than having one obviously correct answer, but this is a matter of having some freedom to choose. I'd favour the first in general, but I'm glad I can choose to highlight the "yeah" on it's own if I want to.
The third, is that if this is actually replicating something you genuinely heard, then put commas in as best reflect the pauses or lack of them that you heard. By extension, if it's dialogue of your own creation, then just go with the voice you hear when you imagine the character saying it.