The first word of a direct quotation is capitalized if it is the beginning of a sentence, even if it's in the middle of your own sentence.
Here's an example:
* Incorrect: She said, "i'm going to the store."
* Correct: She said, "I'm going to the store."
However, if the quotation is embedded within your own sentence and does not represent a complete sentence, you do not capitalize the first word.
Here's an example:
* Correct: He said he wanted to "go to the store."