The sacraments are holy mysteries of God. "Sacra-" is derived from the word "sacred," meaning "holy." The Greeks called them "sacred mysteries." A sacrament has two parts: an outward and visible sign, and an inward and spiritual grace (gift).
Signs tell us things we might not otherwise know! A sacrament is an outward sign which we can see and feel that tells us that God has an inward and spiritual grace for us.
Grace is the free gift of God’s favour. We humans are separated from God and made weak by sin and the power of evil. God's grace restores us to him, and makes us holy and strong to stand firm against evil. God’s grace is given to us especially in the sacraments.
The sacraments are not "God's dispensing machines," nor are they magical. God longs to grant us his grace, but he makes it available only to those who submit themselves to his love and will. We submit ourselves to God by turning to him in faith (in trust) and penitence (in humility).