I believe there are two kinds of proof by contradictions, one which I understand, and another one which I have some questions. I'll begin with the first one.
1st CASE
Suppose I can logically show that from a premise A, a conclusion B follows (that is if A is true then B is true). However, I previously know that B is false. Therefore, I can conclude that A cannot be true. For example, when proving that there are infinite primes I show that:
If there is a finite number of primes (A) then 1 can be divided by a prime (B). I know from previously established facts that B is false, therefore A cannot be true.
2nd CASE
However, suppose that from a premise A, I can show that the conclusion not-A follows.
For example, when proving $\sqrt{2}$ is irrational I do the following:
If $\sqrt{2}$ can be written as an irreducible fraction (A) then it is not written as an irreducible fraction (not-A).
In this case, I cannot see how we can deduce that A must be false, since I cannot be certain that the consequent (not-A) is either true or false, since its truth value depends on my assumption.
Perhaps I could argue that $\sqrt{2}$ being rational implies that math is inconsistent, and then, since we know that math is consistent, we can conclude that $\sqrt{2}$ is not rational. But then we would also need to justify why we "know" or "assume" that math is consitent.
For the second case, the argument runs by cases. Roughly, it is:
P1. $A\lor \neg A$, by the principle of the excluded middle.
P2. $A \implies \neg A$, by assumption.
By applying P2 to P1, we have:
L3. $\neg A \lor \neg A$
And by disjunction reduction:
C4. $\neg A$
QED