There exist countless guides for how to prepare for Holy Communion at Mass, many of them written by saints or other holy men and women.
It's important to remember that there is no particular right way to prepare, and that the primary requirement for a fruitful Communion is a heart open and ready to receive Jesus.
Nevertheless, if you are interested in what the saints had to say, here is what St. Francis de Sales recommends in his Introduction to the Devout Life.
1Prepare your heart before Mass begins
In the beginning, and before the priest goes up to the altar, make your preparation with his—placing yourself in God’s Presence, confessing your unworthiness, and asking forgiveness.
2Listen to the readings and meditate on salvation history
Until the Gospel, dwell simply and generally upon the Coming and the Life of our Lord in this world.
3Be attentive to Jesus' teaching in the Gospel
From the Gospel to the end of the Creed, dwell upon our Dear Lord’s teaching, and renew your resolution to live and die in the faith of the Holy Catholic Church.
4Offer your heart to God
From thence, fix your heart on the mysteries of the Word, and unite yourself to the Death and Passion of our Redeemer, now actually and essentially set forth in this holy Sacrifice, which, together with the priest and all the congregation, you offer to God the Father, to His Glory and your own salvation.
5Desire to be in union with God
Up to the moment of communicating, offer all the longings and desires of your heart, above all desiring most earnestly to be united for ever to our Savior by His Eternal Love.
6Give thanks to God
From the time of Communion to the end, thank His Gracious Majesty for His Incarnation, His Life, Death, Passion, and the Love which He sets forth in this holy Sacrifice, intreating through it His favor for yourself, your relations and friends, and the whole Church; and humbling yourself sincerely, devoutly receive the blessing which our Dear Lord gives you through the channel of His minister.