X^2-1 factorises: (X-1)(X+1). One of these factors appears on the other side of the equation, and so it's a common factor. However, we can't remove it without putting in a proviso: X must not equal 1. Now we can remove the common factor: 3X^2/(X+1)=4. Multiply through by X+1: 3X^2=4X+4, which becomes the quadratic: 3X^2-4X-4=0.
This factorises: (3X+2)(X-2)=0 so X=-2/3 or 2. So X is not equal to 1 and it was therefore OK to divide by X-1.