I think doing it privately FIRST is the best thing to do, send them a letter saying.
Dear X
Giving Praise to God greeting. Explain the teaching of the Church which they are violating in a clear and kind way. Then kindly say your action Y, is in violation of that teaching. Explain to them how they shouldn’t receive the sacraments (excluding confession), and strongly encourage them to go to confession and change their way of life. Then explain to them that you would like to talk to them one on one if at all possible.
Sincerely Bishop Z
If that fails, then give the office a call asking to talk to X.
if that fails, then try to set up a meeting with them to talk to them one on one.
if that fails, then you publicly denounce what they are doing. Warning them that if they don’t atleast talk to you that you will make it known your opposition to Catholic Teaching.
The Goal of the Bishop is to save souls, not make himself look good by publicly excommunicating a politician who is Catholic. It is better for the person and the Catholic Church.
I think why we don’t see bishops doing public excommunication now of days is either that they talk with these politicians one on one, or they think that doing it publicly will do more harm then good.