In all academic writing, Quotations must have appropriate punctuation.
In order to determine how to punctuate the phrase that comes before a quotation, you need to know whether the phase is an independent clause. Here, you have three options:
Scott informed Zelda, “You must stop jumping into fountains.”
In his famous speech “The Ballot or the Bullet,” Malcolm X observes, “The government has failed us. You can’t deny that” (45).
She knows she is no longer safe, saying, “I feared for my Safety in this wicked House” (28).
Macbeth says, “Life’s but a walking shadow” (5.5.24).
Interestingly, Malcolm X distrusted both white conservatives and liberals and “never voted for either political party” (Guzman).
Adapted from "Quotation Marks with In-Text (Parenthetical) Citations" by Lumen Learning, which is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0).