Rituals have many functions. They cement the bonds of a society or community. They allay anxiety in a hostile universe. They provide the support of others for religious faith. But in most religions they also have more primitive and selfish goals, similar to magic.
Prayer invokes the help of invisible beings.
Sacrifice and offerings try to control fate or to ward off the anger of the god or gods. Communion tries to acquire some of the magical power of the deity. All ritual acts may be thought to help in achieving a favourable afterlife. Ritual and ceremony in historical pantheism. Most pantheists have emerged from specific religions and have practised the normal rituals of that religion.