The line you have included in the question is the final line of Milton's "When I Consider How My Light Is Spent (On His Blindness)," so in order to realize how Milton reaches that conclusion, we will need to analyze the poem from beginning to end.
The poem is best divided into two major sections. In the first part of the poem, the speaker begins,
When I consider how my light is spent,
Ere half my days, in this dark world and wide,
And that one Talent which is death to hide
Lodged with me useless, though my Soul more bent
To serve therewith my Maker, and present
My true account, lest he returning chide;
“Doth God exact day-labour, light denied?”
I fondly ask (1–8).
Milton began going blind, and he expresses here how worried he is that he will not be able to use "that one Talent" that he thinks can best serve his God. The first couple of lines see Milton reflecting on his gradually waning vision; because of his worsening blindness, he feels increasingly more in the "dark world." His gift (his poetry) is now useless to him, he feels, since he cannot read (or write or revise his writing). He feels he has used his talent to honor God, and now he is not sure how he can do that any more.
The response he gets leads to the conclusion in the final line:
But patience, to prevent
That murmur, soon replies, “God doth not need
Either man’s work or his own gifts; who best
Bear his mild yoke, they serve him best. His state
Is Kingly. Thousands at his bidding speed
And post o’er Land and Ocean without rest:
They also serve who only stand and wait.” (8-14)
The voice that "replies" to Milton is, presumably, an inner voice that reminds him that there are other ways to serve God. The voice tells him that God does not need or demand a believer's work. One only needs to submit to God's "mild yoke." He says that many serve God by moving "o'er Land and Ocean without rest." However, a person can still serve God by simply patiently obeying and quietly following God's word. This helps Milton feel that he is still able to worship the deity even though he will no longer praise him through his writing.