A quantum bit can be represented by a two-level quantum mechanical system, and described by a state vector in two-dimensional Hilbert space. Traditionally, Dirac, or bra-ket notation has been used to represent them. The two computational basis states are therefore often written as |0〉 and |1〉 (pronounced: 'ket 0' and 'ket 1' respectively). A pure qubit state is a linear superposition of the two states. This means that such a qubit can be represented as:
|ψ〉 = α|0〉 + β |1〉 or as $\begin{bmatrix} α \\ β \end{bmatrix}$
where α and β are probability amplitudes and are in general complex numbers. When a qubit is measured in the standard basis, the probability that the outcome is |0〉 is $|α|^2$ and the probability that the outcome is |1〉 is $|β|^2$. As the absolute squares of the amplitudes represent probabilities, therefore α and β are constrained by the following equation:
$|α|^2$ + $|β|^2$ = 1
X is $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$
|ψ'〉 = X|ψ〉 = $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\begin{bmatrix} α \\ β \end{bmatrix} = \begin{bmatrix} 0*α + 1*β \\ 1*α + 0*β \end{bmatrix} = \begin{bmatrix} β \\ α \end{bmatrix}$
Now |0〉 is $\begin{bmatrix} 1 \\ 0 \end{bmatrix}$
and |1〉 is $\begin{bmatrix} 0 \\ 1 \end{bmatrix}$
|1〉 = X|0〉 = $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0*1 + 1*0 \\ 1*1 + 0*0 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$
|0〉 = X|1〉 = $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0*0 + 1*1 \\ 1*0 + 0*1 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$
Similarly for H = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}$
|ψ'〉 = H|ψ〉 = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} α \\ β \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}}*α + \frac{1}{\sqrt{2}}*β \\ \frac{1}{\sqrt{2}}*α -\frac{1}{\sqrt{2}}*β \end{bmatrix} = \begin{bmatrix} \frac{α + β}{\sqrt{2}} \\ \frac{α - β}{\sqrt{2}} \end{bmatrix}$
Now |0〉 is $\begin{bmatrix} 1 \\ 0 \end{bmatrix}$
and |1〉 is $\begin{bmatrix} 0 \\ 1 \end{bmatrix}$
H|0〉 = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}}*1 + \frac{1}{\sqrt{2}}*0 \\ \frac{1}{\sqrt{2}}*1 -\frac{1}{\sqrt{2}}*0 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1 }{\sqrt{2}} \end{bmatrix}$ = $\frac{1}{\sqrt{2}}$[|0〉 + |1〉]
H|1〉 = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}}*0 + \frac{1}{\sqrt{2}}*1 \\ \frac{1}{\sqrt{2}}*0 -\frac{1}{\sqrt{2}}*1 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ -\frac{1 }{\sqrt{2}} \end{bmatrix}$ =$\frac{1}{\sqrt{2}}$[|0〉 - |1〉]
CNOT is a two qubit gate so matrix representation is 4 X 4
CNOT= $\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}$
and lets define |$\phi$〉 = (α|0〉 + β|1〉) ⊗ ( б|0〉 + η|1〉) = $\begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \\ \alpha_4 \end{bmatrix}$
where $|α|^2$ + $|β|^2$ = 1 and $|б|^2$ + $|η|^2$ = 1
|$\phi$〉 = $α_1|00〉 + α_2|01〉 + α_3|10〉 + α_4|11〉 $
where $|α_1|^2$ + $|α_2|^2$ + $|α_3|^2$ + $|α_4|^2$ = 1.
$α_1 = α ⊗ б$
$α_2 = α ⊗ η$
$α_3 = β ⊗ б$
$α_4 = β ⊗ η$
|$\phi'$〉 = CNOT|$\phi$〉 = $\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}\begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_4 \\ \alpha_4 \end{bmatrix} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \\ \alpha_3 \end{bmatrix} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_4 \\ \alpha_4 \end{bmatrix} = \begin{bmatrix} α ⊗ б \\ α ⊗ η \\ β ⊗ б \\ β ⊗ η \end{bmatrix}$
Now when α = 1, there is no change in the state of second qubit, however, when β = 1 then the state of second qubit is flipped. It is easy to understand when α, β, б and η are either 0 or 1 but not otherwise. CNOT gate is one of the fundamental entangling gates. so if you have difficulty then I can elaborate further. I hope it helps...