Method of solving problems in teaching