Divorce is a grave offence against the natural law (Catechism, 2384). Therefore, if one is culpable in the divorce, it is important that he or she receive the Sacrament of Reconciliation right away. Thereafter, the circumstance of being divorced generally does not prevent him or her from receiving the Eucharist.
If a divorced person remarries invalidly (i.e. without an annulment) he or she would then be prohibited from receiving the Eucharist as long as that situation persists or until he or she has received the Sacrament of Reconciliation and committed to living in complete continence.