From my “watched a YouTube video” understanding of Gödel’s Incompleteness Theorem, a consistent mathematical system cannot prove its own consistency, and any seemingly consistent system could always have a fatal contradiction that invalidates the whole system, and the only way to know would be to find the contradiction.
So if at some point our current system of math gets proven inconsistent, what happens next? Can we tweak just the inconsistent part and have everything else still be valid or would we be forced to rebuild all of math from basic logic?


There is an MO thread about this:
https://mathoverflow.net/questions/90876/what-would-be-some-major-consequences-of-the-inconsistency-of-zfc
Basically “our mathematical system” for mathematicians usually (though not always) refers to so-called ZFC set theory. This is an extremely powerful theory that goes far beyond what is needed for everyday mathematics, but it straightforwardly encodes most ordinary mathematical theorems and proofs. Some people do have doubts about its consistency. Maybe some inconsistency in fact could turn up, likely in the far-out technical fringes of the theory. If that invalidates some niche areas of set theory but doesn’t affect the more conventional parts of math, then presumably the problem would get fixed up and things would keep going about like before. On the other hand, if the inconsistency went deeper and was harder to escape from, there would be considerable disruption in math.
See Henry Cohn’s answer in the MO thread for the longer take that the above paragraph is cribbed from.
I’m not going to dive in there at the moment, correct me if I’m wrong (the ‘the problem would get fixed up and things would keep going about like before’ case I suppose).
To answer OP’s question, basically the same thing that happened last time an inconsistency was found, Russel’s paradox, which, to massively simplify, was add a new axiom that says you can’t do that and carry on. (Which gave rise to the aforementioned ZFC set theory). Working math is still going to work in any case.
Yes, that’s Frege’s system mentioned in Henry Cohn’s post. But that happened in a very naive time compared with today. So it would be more of a surprise if something like that happened again.