In the Catholic Church, the validity of a marriage is recognized when it is celebrated according to the Church's laws and requirements. If someone got married solely in a civil ceremony (by the court) and not in the Catholic Church, the marriage is not considered valid in the eyes of the Catholic Church. Therefore, they are not considered sacramentally married from a Catholic perspective.
If a person who has gone through a civil divorce wants to get married in the Catholic Church, they would generally need to go through an annulment process (also known as a declaration of nullity) for their previous civil marriage. An annulment is a formal process in the Catholic Church that examines whether there was a defect in the marital consent or any other impediment that prevented the marriage from being valid in the first place. If the Church determines that the previous civil marriage was not valid, they are free to marry in the Catholic Church.
It's important to note that the annulment process can vary in duration and complexity, depending on the circumstances of the previous marriage. It is recommended to seek guidance from a priest or a marriage tribunal in the local diocese to understand the specific steps and requirements for pursuing an annulment.
The Catholic Church takes marriage very seriously and wants to ensure that individuals entering into a new marriage do so with a clear understanding of the Church's teachings on marriage and with their previous marital status appropriately resolved.