How does a Catholic renounce membership in the Freemasons?
Catholics are not permitted to join the Freemasons. Canon Law prescribes a “just penalty” for mere members and interdict for those who hold office (canon 1374). These two penalties, however, are not automatically imposed by the mere action of joining or holding office, they must be actually imposed by the legitimate authority (usually the local Bishop).
If someone has joined the Freemasons and has not been subject to a penalty imposed by the legitimate authority then they can simply formally renounce their membership in the Freemasons and go to confession.
If someone has been subject to an imposed penalty then after renouncing their membership and going to confession they would need to appeal to the authority who imposed the penalty to have it lifted.