"Turn on the light," Tom said halfheartedly.
Here's why:
* Comma after "light": We use a comma to separate the direct quote ("Turn on the light") from the speaker ("Tom") and the rest of the sentence.
* Comma after "light": We use a comma to separate the direct quote from the rest of the sentence.
* Period at the end: We use a period at the end of a declarative sentence.