An excerpt from Secrets of Heaven by Emanuel Swedenborg, section #7038
True worship consists in the performance of useful functions, thus in the exercises of charity. Anyone who believes that serving the Lord consists solely in frequenting a place of worship, in hearing preaching there, and in praying, and that this is sufficient, is much mistaken. The very worship of the Lord consists in performing useful functions. During a person’s life in the world useful functions consist in everyone’s performing the duties appropriate to their stations, and thus from the heart being of service to their country, to societies, and to the neighbor; in dealing sincerely with their fellows; and in performing good deeds with prudence in accordance with each person’s character. These useful functions are chiefly the works of charity, and are those whereby the Lord is chiefly worshiped. Frequenting a place of worship, hearing sermons, and saying prayers are also necessary, but without the above activities they avail nothing, because they are not of life itself; they only teach what life must be. The angels in heaven get all their happiness from performing useful functions, according to useful functions, so that to them being useful is heaven.
That happiness comes from divine order according to usefulness can be seen from the things in human beings that correspond to those which are in the universal human. Those external senses, namely, sight, hearing, taste, smell, and touch, are correspondent, as has been shown at the end of many chapters. These senses therefore have delights exactly in accordance with the useful functions they perform; the most delightful is the sense of marriage love, on account of its greatest useful function, because from this comes the propagation of the human race, and from the human race, heaven; the delight of taste follows next, because it serves for the nourishment and thereby for the health of the body, in accordance with which is the sound action of the mind; the delight of smell is less, because it merely serves for recreation; and thus also for health; the delight of hearing and that of sight are in last place, because they merely take up those things that will be of service to useful functions, and wait upon the intellect, and not so much the will.
From these and other like facts it becomes plain that it is useful functions according to which happiness is given in heaven by the Lord; and that it is useful functions through which the Lord is mainly worshiped.