When someone is cannonized, that’s when the Holy Spirit reveals to the Church that the Saint is in fact in heaven.
Catechism of the Catholic Church:
828 By canonizing some of the faithful, i.e., by solemnly pro claiming that they practiced heroic virtue and lived in fidelity to God’s grace, the Church recognizes the power of the Spirit of holiness within her and sustains the hope of believers by proposing the saints to them as models and intercessors. “The saints have always been the source and origin of renewal in the most difficult moments in the Church’s history.” Indeed, “holiness is the hidden source and infallible measure of her apostolic activity and missionary zeal.”