The above text should really be taken in conjunction with the context which follows in verse 12 of Ephesians 5, namely :
... it is a shame even to speak of those things which are done of them in secret.
Sins of the kind you mention are particularly personal and discretion is necessary. It would be highly inappropriate to discuss such matters with a young or inexperienced person. It would also be inappropriate for someone prone to such things to talk privately with another person, also prone to such things. I surely do not need to say that they would not be discussed between genders.
The ministry, that is, in context, the apostle, advises that certain matters should not even be named among saints. But to do so, he himself had to name them. Therefore if such matters have to be spoken of, then it should be spoken of to the ministry. Or to the presbuteros, the presbytery - the eldership.
Such a one should be restored, not indulged. They should be warned, but not overwhelmed. These matters require spirituality which is why the apostle says that the spiritual should restore such a person, in meekness, considering themselves, lest they also be tempted. But this speaks of a fault, not outrageous sin which the general public would find offensive. Such serious matters require immediate discipline, possibly exclusion.
Brethren, if a man be overtaken in a fault, ye which are spiritual, restore such an one in the spirit of meekness; considering thyself, lest thou also be tempted. [Galatians 6:1 KJV.]
We see how a person in Corinth was excluded as 'wicked' for such things. Yet even he was restored and received again with love, obviously penitent. If un-penitent, and there do appear to have been such at Corinth, they would face Paul, personally, when he visited again (after the second epistle) and he says he will not spare them.
I told you before, and foretell you, as if I were present, the second time; and being absent now I write to them which heretofore have sinned, and to all other, that, if I come again, I will not spare: II Corinthians 13:2 [KJV]
It requires considerable maturity to deal with such things. It is not for novices.
I mention this from my own perspective, being sixty seven years of age.