Check out this link from the Vatican website:
Basically you have to mentally renounce, realize the "external manifestation of that decision", and "reception of that decision by the competent ecclesiastical authority".
Easy enough. Except if you look at #7:
7. "It remains clear, in any event, that the sacramental bond of belonging to the Body of Christ that is the Church, conferred by the baptismal character, is an ontological and permanent bond which is not lost by reason of any act or fact of defection."
The document above spells out the way that it is necessary to formally renounce the Catholic Faith. This has the result of rendering you no longer subject to the laws of the Catholic Church. As they have pointed out above, your Baptism makes you ontologically something else: a child of God, and there is nothing that any human can do to "undo" that.