I repost this beautiful prayer to Mary for a good death. I make it my own, and I beg our Lady as does this great saint:

OH Mary, what will be my death? I tremble and am confounded when I now consider my sins, and think of that great, decisive moment of my salvation or eternal damnation, when I shall die and be judged. Oh my most sweet mother, my hopes are in the blood of Jesus Christ, and in thy intercession. Oh consoler of the afflicted, do not abandon me then; do not cease consoling me in that great affliction. If now I am tormented with remorse on account of past sins, the uncertainty of pardon, the danger of relapse, and the rigor of divine justice, what will become of me then? If thou dost not aid me, I am lost. Ah, my Lady, before my death arrives, obtain for me a great sorrow for my sins, a true amendment, and fidelity to God for the life that remains to me. And when the last moment of my life comes, oh Mary my hope, aid me then in my great distress, and encourage me then that I may not despair at the sight of my sins which the demon will present to me. Obtain for me the grace to invoke thee then more constantly, that I may expire with thy sweet name, and that of thy most holy Son, upon my lips. And now, oh Lady, pardon my boldness: before I expire come thyself to console me by thy presence. This grace thou hast granted to so many of thy servants, I also wish and hope for it. I am, indeed, a sinner, and I do not merit it; but I am thy servant, who loves thee, and has great confidence in thee. Oh Mary, I wait for thee, do not leave me disconsolate. At least, if I am not worthy of so great a favor, assist me from heaven, that I may die in the love of God and of thee, and come to love God and thee eternally in paradise.

St. Alphonsus Liguori