An easy way to format the Catechism is to use the online version found on the United States Conference of Catholic Bishops (USCCB) website. The bibliography entry is given below along with a footnote example.
John, Paul II. Catechism of the Catholic Church. 2nd ed. Washington, DC: United States Catholic Conference, 2011. https://www.usccb.org/sites/default/files/flipbooks/catechism/.
Footnote:
1. John Paul II, Catechism of the Catholic Church, 2nd ed., (Washington DC: United States Catholic Conference, 2011), sec. 782,, https://www.usccb.org/sites/default/files/flipbooks/catechism/.