Most stories contain a mixture of direct speech and reported speech.
In direct speech, we write the exact words that a character says and put speech marks around them.
"I'm tired," said Peter.
Reported speech tells the reader what the character said, but without using the exact words and without speech marks.
Peter said he was tired.
There are sometimes a number of ways of changing direct speech into reported speech, but the important thing is that the reported speech must give the same information as the direct speech.
For example, all three of these sentences give the same information.
"Thank you for having me to stay," said Kim to her grandmother.
Kim said thank you to her grandmother for having her to stay.
Kim thanked her grandmother for having her to stay.
Reported speech is sometimes called indirect speech.