Thanks for the question! So in this question, the first premise actually doesn’t matter. We know that X is true (or X exists). We also know that X —> B. Well, if we know X, and X—>B, then by combining those, we must also know that B. And that’s how we can conclude that B exists.
Here’s an example replacing the letters with things that might make more sense. Let’s say that humans exist. And if humans exist, then monkeys exist (since humans evolved from monkeys). Well, then we know that monkeys exist! And how do we know that? Because we know that if humans exist, then monkeys exist, and we also know that humans exist. That’s the same kind of logic as what’s going on here.
Hope this helps! Feel free to ask any other questions that you might have.