I suppose we could characterize the deconsecration of a church as either accidental or purposeful. Accidental deconsecration or [desecration] (http://www.newadvent.org/cathen/04748c.htm) occurred when violence or defilement happened within it, most particularly the shedding of blood. In this case there were set rituals for “reconciling” a church. Likewise, a church could be deconsecrated if the church fabric was substantially damaged. Altars could be deconsecrated if they were significantly damaged, especially if the altar stone (the small box containing the relic of a saint and placed into the altar—the sine qua non of an altar) was damaged or its relic removed. According to the [Catholic Encyclopedia] (http://www.newadvent.org/cathen/04276a.htm) (1908 edition online):
From the axiom in canon law "Consecratio adhæret parietibus Eccelesiæ" [i.e., its consecration adheres to the walls of a church], it follows that a church loses its consecration (1) when the walls of the church are totally or in greater part simultaneously demolished; (2) when the inner walls are totally or in greater part simultaneously destroyed by fire; (3) when an addition is made to the walls of the church in length, breadth, or height, greater than the original walls.
As far as purposeful deconsecration goes, I’m not aware of any specific ritual to deconsecrate a Catholic church. I recall that Evelyn Waugh asked Fr. Ronald Knox (his friend and spiritual advisor) for details on how to do this for a scene in Brideshead Revisited where the Brideshead family chapel is closed. Knox wasn’t aware of a ritual, but suggested these actions, which Waugh recreates in the novel:
Cordelia Flyte says: “They’ve closed the chapel at Brideshead, Bridey and the Bishop; mummy’s Requiem was the last mass said there. After she was buried the priest came in—I was there alone. I don’t think he saw me—and took out the altar stone and put it in his bag; then he burned the wads of wool with the holy oil [used for baptism, confirmation, and the last anointing] on them and threw the ash outside; he emptied the holy-water stoop and blew out the lamp in the sanctuary, and left the tabernacle [where consecrated Hosts were kept] open, and empty, as though from now on it was always to be Good Friday. I suppose none of this makes any sense to you, Charles, poor agnostic. I stayed there till he was gone, and then, suddenly, there wasn’t any chapel there any more, just an oddly decorated room. I can’t tell you what it felt like.”