When the forces are in the same direction then add the forces. Let F1 and F2 be the force, the net force F= F1+F2.
When the forces are in the opposite direction then subtract the forces. Let F1 and F2 be the force, the net force F= F1-F2. The direction is along the force with the higher magnitude.