(다)고 말했다 is used for reporting speech in the past tense. It roughly translates as ‘they said that…’. Note that the final verb or adjective in the quote is left in ‘dictionary’ form:
이 식당이 비싸다고 말했어요.
They said this restaurant is expensive.
그녀는 도와 주셔서 감사합니다고 말했어요.
She said thanks for helping.
저는 친구에게 죄송하다고 말했어요.
I said sorry to my friend.
그는 사과 할 필요가 없다고 말했어요.
He said there was no need to apologise.
친구가 한국에 이사하고 싶다고 말했어요.
My friend said (s)he wants to move to Korea.
한국 음식은 맵다고 말했는데 조금 짜는 것 같아요.
They say that Korean food is spicy, but I think it’s a little salty.