Daniel says many who sleep in the dust of the earth will awake, some to everlasting life and some to shame and everlasting contempt. The passage connects this to a time of trouble and deliverance for those written in the book. Daniel 12:2
Daniel 12:1–4 describes a severe crisis tied to “that time,” when Michael steps in on behalf of Daniel’s people. In the middle of unmatched distress, deliverance is promised for those “written in the book.” The passage then widens to a future awakening of the dead, dividing outcomes into lasting life or lasting disgrace. These verses conclude the long vision that began earlier and has been narrating conflicts involving kings and pressures on Daniel’s people (see Daniel 10:1). “At that time” links directly back to the final scenes described just before this section (compare Daniel 11:45), so the events here are presented as the climax.
Daniel 12:1–4 presents the climax of the vision: a final-like crisis, divine protection, and ultimate outcomes beyond death.
A careful answer keeps the immediate passage, the book's argument, and the whole-Bible storyline together, so the question is answered in context instead of as a detached idea.
Start with Daniel 12:2, then read the surrounding section so the answer stays connected to the passage's flow.
2Many of those who sleep in the dust of the earth shall awake, some to everlasting life, and some to shame and everlasting contempt.