I understand the basic principle of the work-energy theorem, but not sure how to factor in friction for these problems. Any help would be greatly appreciated.

The work done by the person pulling on the rope plus the work done by friction opposing the box's movement must equal the gain in mechanical energy of the box. Remember that work = force times displacement in the direction of that force, so in the case of the person pulling on the rope with force F:

W_person = Fd cos(theta)

where d = displacement

For the work done by friction given the friction force F_f:

W_friction = -F_f d

Note the minus sign, which is due to the fact that the displacement of the box is opposite in direction to the force of friction.