Document Lumen Gentiumthat outlines what is called "Universal Call to Holiness."
First - Local Bishop does an investigation gathering statements from witnesses, the person's writings, etc. The Bishop declares that they are worthy to be a saint and forwards an application to the Congregation for the Causes of Saints.
Second, - the Congregation for the Causes of Saints decides to accept the application and does its own investigation. By accepting the application the person gains the official title "the Servant of God."
Third - Congregation for the Causes of Saints declares that the person lived a life heroically virtuous life. The person is then officially considered for sainthood. With this official consideration the person gains the title of "Venerable." However there is no declaration that the person has gone to heaven.
Fourth - This requires that a miracle happened through this person's intercession. This miracle is almost always a healing. The healing has to be instantaneous, permanent, and complete while also being scientifically unexplainable. Miracles have to be first verified as scientifically unexplainable by a group of independent doctors. Then the person is approved by a panel of theologians. The final approval has to come from the pope. With the recognition that one miracle occurred the person gains the title of "Blessed." With this title goes the official recognition that the person has gone to heaven.
Fifth - A second miracle must have happened. The same scrutiny is applied to the second miracle. Then if the appropriate scrutiny is approved, the person is declared a "Saint."
Of course Popes can sidestep these requirements at their whim as exemplified by Pope Francis recognizing Pope John XXIII as a Saint without a second miracle. And the Opus Dei founder Josemaria Escriva had no "devils advocate" and negative testimony was not permitted like from his nephew and his secretary. .... etc.