How is the idea of the ritual purity implemented in the Catholic Church? How is the idea of the ritual purity implemented in the Catholic Church? We know that in the Old Testament priests needed to be ritually pure in order to perform rituals. How is this idea implemented and performed in the Catholic Church through history up till today? What criteria does one need to satisfy to be ritually pure?

I am interested in the Catholic viewpoint.
Although the Old Law's ceremonial precepts are no longer in force since Christ's passion, ritual purity is a prominent aspect of priestly celibacy.


Essence of priestly celibacy

Celibacy = unmarried, although in this context it can also mean perpetual continence, as priests can be married (and unmarried priests have never been permitted to marry).

Besides the practical reasons (which can apply to non-priests, too) of


being freed from the solicitudes of married life, not being so tied to worldly matters, or having a heart divided between wife/husband/family and pastoral duties (1 Cor. 7:33-34*);


*"But he that is with a wife, is solicitous for the things of the world, how he may please his wife: and he is divided. And the unmarried woman and the virgin thinketh on the things of the Lord, that she may be holy both in body and in spirit. But she that is married thinketh on the things of the world, how she may please her husband."

or


the spiritual reasons of being able to attain a higher degree of charity/holiness/perfection (Trent sess. 24 can. 10; Mt. 19:29*; Apoc. 14:4†) by following the evangelical counsels and not just the precepts;


*"And every one that hath left house, or brethren, or sisters, or father, or mother, or wife, or children, or lands for my name's sake, shall receive an hundredfold, and shall possess life everlasting." 
†"These are they who were not defiled with women: for they are virgins. These follow the Lamb whithersoever he goeth. These were purchased from among men, the firstfruits to God and to the Lamb"

ritual purity is probably the strongest argument for priestly celibacy because it pertains to the essence of the priesthood, which is to offer sacrifice (sacerdos = "giver of the sacred"; sacer = "sacred", dare = "to give").

Ritual purity

On ritual purity in the Old and New Testaments, see Priestly Celibacy: Theological Foundations by Fr. Gary Selin, pp. 139-144.

Ch. 3 goes over the threefold dimension of priestly celibacy: christological (conforming to Christ), ecclesiastical (under which he classes ritual purity), and eschatological (because celibacy points to the life to come, where "they shall neither marry nor be married", Mt. 22:30).

Separation/distinction honors the sacred.

Magisterial Teaching

Pope Pius XII, 1954 encyclical Sacra Virginitas §23:


  
  Consider again that sacred ministers do not renounce marriage solely on account of their apostolic ministry, but also by reason of their service at the altar. For, if even the priests of the Old Testament had to abstain from the use of marriage during the period of their service in the Temple, for fear of being declared impure by the Law just as other men,42 is it not much more fitting that the ministers of Jesus Christ, who offer every day the Eucharistic Sacrifice, possess perfect chastity? St. Peter Damian, exhorting priests to perfect continence, asks: "If Our Redeemer so loved the flower of unimpaired modesty that not only was He born from a virginal womb, but was also cared for by a virgin nurse even when He was still an infant crying in the cradle, by whom, I ask, does He wish His body to be handled now that He reigns, limitless, in heaven?"43
  
  
  42. Cf. Lev. XV, 16-17 XXII, 4; I Sam. XXI, 5-7; cf. S. Siric. Papa, Ep. ad Himer. 7; PL LVI, 558-559.43. S. Petrus Dam., De coelibatu sacerdotum, c. 3; PL CXLV, 384 [English transl.].


Old Testament

Ibid. ch. 3 §"Ritual Purity in the Judaic Law", pp. 139-141:


  tahor (clean, pure) or tame (unclean, impure). […] Separation  is the concrete, visible expression of the exalted holiness of God, and the ritual purity laws maintained this protective system of separation. […] To come into contact with blood was to come into contact with the divine and thus one contracted a ritual impurity, “a holy contamination,” rather than a moral impurity. […] In certain rabbinic texts, the liturgical objects themselves were understood to “pollute,” for example, the handling of a sacred scroll would soil the hands of the rabbi, and he was required to wash his hands after reading it. [fn. 103: "[…] Even today, the liturgical vessels used at Mass are said to be purified when elements of the sacred species are removed."]


New Testament

Ibid. ch. 3 §"Ritual Purity in the Patristic Tradition" p. 144 quotes Ambrosiaster's Questiones Veteris et Novi Testamenti, 127, in Corpus Scriptorum Ecclesiasticorum Latinorum 50, 415:


  Compared to the stars, the light of a lamp is but fog; while compared to the sun, the stars are obscure; and compared to the radiance of God, the sun is but night. Thus are the things which, in relationship to us, are licit and pure, and are as if illicit and impure with respect to the dignity of God; indeed, no matter how good they are, they are not appropriate to the person of God.


This is the same reason for why women and other are sacred vessels are veiled in church.

Abstaining from conjugal relations

before sacrificing

So as not to confuse two different sacreds, similar reasons are given for abstaining from conjugal relations before offering sacrifice.

1 Samuel 21:2-6:


  And David said to Achimelech, the priest: The king hath commanded me a business, and said: Let no man know the thing for which thou art sent by me, and what manner of commands I have given thee: and I have appointed my servants to such and such a place. Now therefore if thou have any thing at hand, though it were but five loaves, give me, or whatsoever thou canst find. And the priest answered David, saying: I have no common bread at hand, but only holy bread [for sacrifice], if the young men be clean, especially from women? And David answered the priest, and said to him: Truly, as to what concerneth women, we have refrained ourselves from yesterday and the day before, when we came out, and the vessels of the young men were holy. Now this way is defiled, but it shall also be sanctified this day in the vessels. The priest therefore gave him hallowed bread: for there was no bread there, but only the loaves of proposition, which had been taken away from before the face of the Lord, that hot loaves might be set up.



Daniel G. Van Slyke, “Abstinence from Conjugal Relations Before Reception of the Body of Christ: A Brief History,” Antiphon 20, no. 2 (2016): 151–72.:



  This passage indicates two situations in which men and presumably their wives abstained from sexual relations during David's time. First, David's soldiers abstained in order to be consecrated at arms or prepared for battle. Second, the priests abstained when serving before the Lord in the Tabernacle and partaking of the holy shew-bread. On this exceptional instance in which non-priests partook of the holy bread, those non-priests could do so only upon affirming that they had abstained from sexual relations.


before receiving Holy Communion

Innocent XI's Cum ad aures (February 12, 1679) on frequent communion (DZ 1147):


  In the case of married persons, however, let them seriously consider this, since the blessed Apostle does not wish them to "defraud one another, except perhaps by consent for a time, that they may give themselves to prayer" [cf. 1 Cor. 7:5], let them advise these seriously that they should give themselves more to continence, because of reverence for the most holy Eucharist, and that they should come together for communion in the heavenly banquet with a purer mind.
  
  In coniugatis autem hoc amplius animadvertant, cum beatus Apostolus nolit eos ‘invicem fraudari, nisi forte ex consensu ad tempus, ut vacent orationi’ (cf. 1 cor 7, 5), eos serio admoneant, tanto magis ob sacratissimae Eucharistiae reverentiam continentiae vacandum purioreque mente ad caelestium epularum communionem esse conveniendum.


(Pope St. Pius X cited (but did not quote) this in his Sacra Tridentina on daily Communion.)

source: this answer to "Is celibacy essential to the Catholic priesthood?"