수고했습니다
수고하셨습니다
Both come from 수고하다 - to make an effort
Both use the past tense particle 였 - 수고했다 - to have made an effort
Both are conjugated formally with ((으)ㅂ니다/)습니다, which is used when the person you are talking TO deserves to be spoken to more respectfully or politely - 수고했습니다
The second one uses the honorific particle 시, which is used when the person you are talking ABOUT deserves more respect