The General Roman Calendar lists the celebration of the Nativity of St. John the Baptist on June 24. It is a solemnity, the highest liturgical rank a day can have.
Normally this would mean that the feast would always be celebrated on June 24, even if it fell on a Sunday.
However, this year (2022), it falls on the same day as the Solemnity of the Sacred Heart of Jesus, which is celebrated on the Friday following Trinity Sunday and falls on a different date each year.
According to the General Norms of the Liturgical Year, when two solemnities are competing for the same day, feasts of Our Lord are given precedence.
Additionally, when possible, a major feast is to be transferred to the closest day on the liturgical calendar.
This year the closest day is June 23, and it makes theological sense that the feast of St. John the Baptist, who prepared the way of the Lord, would precede the feast of the Sacred Heart of Jesus.