I'm a bit of a novice here, but I think this may help.
(Note: I'm using Peano Arithmetic (PA) here but you can replace it with whatever theory you're talking about the Second Incompletness Theorem (G2) with respect to.)
- A theorem of PA is defined to be a sentence in PA's language (i.e. a string of PA's symbols satisfying certain conditions) which can be concluded from the axioms of PA by finite applications of the rules of inference of PA (those of first-order logic).
- If S is a theorem of PA, we say PA proves S (symbolically, PA$\vdash$S). Otherwise, we say PA does not prove S (symbolically, PA$\nvdash$S). With this notation, we can state G2 as PA$\nvdash$ConPA].
- "PA is consistent" means there is no pair of theorems of PA which are each other's negation, and "inconsistent" means not consistent.
Clarifying Key Notions
There is a statement (let us call it ConPA) in the language of PA (i.e. ConPA is a string of symbols that can actually be written out--although it takes pages), that is true in the standard model of PA iff PA is consistent (and so its negation is true iff PA is inconsistent). Crucially, by the previous sentence, I do not mean PA can prove ConPA iff PA is consistent, and I do not mean ConPA is true iff PA can prove ConPA. I mean ConPA is true iff PA is consistent. (When people talk about whether PA can prove its own consistency, all they are talking about is whether PA proves ConPA.) G2 is this: "if PA is consistent, PA does not prove ConPA i.e. PA$\nvdash$ConPA." Note that G2 is not a theorem of PA. As I've presented it here, G2 is just a general fact about the world, and is not a sentence (let alone a theorem) of any formal theory (although, as I recall, it can be sort of paraphrased and proven in some formal theories in much the same way that, in PA, ConPA paraphrases "PA is consistent" although PA doesn't prove ConPA). It is a direct consequence of the soundness of PA (the fact the axioms of PA are true and the rules of first-order logic are truth preserving) that if PA is consistent then PA$\nvdash \neg$ConPA--this is not a consequence of G2 as far as I can see.
Actually Answering the Question
If I understand the question correctly, it expresses concern that it follows from G2 that PA (or any formal theory) is consistent since if it wasn't there would be a contradiction in it and that would mean PA would prove its own inconsistency, which is just what G2 says it cannot do--a putative contradiction itself.
Various issues with that: G2 doesn't say that PA can't prove its own inconsistency; it says that if PA is consistent, it can't prove its own consistency--an inconsistent theory proves everything in its language. While it does follow from the soundness of PA (which is a fact) that if PA is consistent then PA doesn't prove its own inconsistency (and maybe this is sometimes considered part of G2), this does not show that PA does not prove its own inconsistency because we don't know for sure that PA is consistent. Now you might be concerned that under the assumption that PA is consistent, the fact (the conclusion of G2) that it cannot prove its consistency (that is, prove ConPA) would mean that PA isn't consistent and this would contradict G2. But this implication (if it doesn't prove a sentence S, then S is false) would only hold if PA were complete and it is not complete as the first incompleteness theorem shows.