Regarding guardian angels, the Catechism of the Catholic Church teaches in number 336 that “from infancy to death, human life is surrounded by their watchful care and intercession.”
It is clear from this text that we enjoy the protection and vigilance of our guardian angels even at the moment of death. These angels don’t only accompany us in this earthly life; their action extends into the next life.
In order to understand the relationship that continues to exist between angels and human beings during our passing from this life to the next, we must understand that angels have been “sent to serve, for the sake of those who are to inherit salvation” (Hebrews 1:14). Similarly, Saint Basil the Great teaches that no one can deny that “beside each believer stands an angel as protector and shepherd leading him to life” (CCC 336).
That is to say, the primary mission of guardian angels is the salvation of mankind: that each of us enters the life of union with God. This mission includes the assistance that guardian angels give to souls at the moment when they present themselves before God.
The Fathers of the Church speak of this mission when they say that guardian angels are present with the soul at the moment of death, and protect it from the last attacks of demons.