The key is that the reaction tries to oppose any external change that is made. If you increase the temperature, it will try move in the direction that will help it consume heat, or lower the temperature. if you increase pressure, the reaction will progress such that the amount of gas released is less..
this is just an easy way to figure out how to decide which way the reaction will go..the principle can be derived thermodynamically.
eg.
A + 2B <----> 3C + 4D delta H<0 (ie, exothermic rxn)
now if you increase temp, the reaction will ty to decrease it, and move in the endothermic direction, that is, backward. if you decrease temp, the opposite will happen.
if you increase pressure, the reaction will progress such that the gas released is less.. in the forward direction, 7 moles are released, while in the backward direction, 3 moles are released. Therefore, on increasing pressure, the reaction will move in the backward direction. Keeping in mind that if the amount of gas released is more, the pressure in the container will increase.