By breaking one of the Six Commandments of the Church, a Catholic incurs a grave sin, yes. Excommunication, no.
There are certain offenses that used to incur "ipso facto" excommunication -- that is, no pronouncement was necessary, but one was excommunicated by the very deed. Examples include assault on a priest, procuring an abortion (this one might have been changed by the modern Church...)
When one is excommunicated, one must have recourse to the correct official. For some offenses (abortion), the Bishop is sufficient. For other offenses, one must have recourse to the Pope!
Anyhow, it's almost common sense that the first thing a returning Catholic must do is make a good Confession.
Matthew