To receive Communion, one must be baptized, and, as for all the sacraments for the living—i.e., for those who have a supernatural life—to be in a state of grace.
“Therefore whosoever shall eat this bread, or drink the chalice of the Lord unworthily, shall be guilty of the body and of the blood of the Lord. But let a man prove himself: and so let him eat of that bread, and drink of the chalice. For he that eateth and drinketh unworthily, eateth and drinketh judgment to himself, not discerning the body of the Lord” (I Col. 11:27-29).
One must also present oneself at the holy table in decent clothing, with a modest and reverential appearance.
Those who are conscious of being in a state of mortal sin must make a sacramental confession before receiving communion. In case of urgent necessity and when a confessor is not available, one must make an act of perfect contrition.
“No one burdened by mortal sin on his conscience, no matter how contrite he believes he is, shall approach holy communion without prior sacramental confession; but if there is urgent necessity and a supply of ministers of confession is lacking, he shall first elicit an act of perfect contrition” (Canon 856, 1917 Pio-Benedictine Code of Canon Law).
Finally, one must know what he receives and approach the holy table with devotion, humility, and modesty, with a pure conscience, and a great love for Jesus Christ, true God and true man, who makes Himself food for our souls.