I found out how magic works, in my world. If a tree falls in a forest and nobody is around to hear it, than it doesn't make a sound, because it is only sound if perceived by a listener. Perception is reality. Reality began when God organized consciousness and spoke them into existence. All things are made of consciousness before becoming material. That is why everything has a spirit.
There are 11 dimensions and God perceives all things in all dimensions at all times. There is never a case where a tree falls and doesn't make a sound. Through God's perception reality is protected. For God, all things are possible because he experiences everything from every angle and can move freely between each dimension.
God created humanoids in his image, meaning they take part in creating reality. Like God, these creatures can turn dreams into reality by properly practicing the gift of free will.
Most creatures have sensory overload when experiencing reality in just three dimensions and are forced to ignore most sensory inputs, subconsciously choosing what to pay attention to based on priority.
The lowest forms of magic are just tricks that fool the senses. Higher forms of magic are much harder to achieve. Through rituals and/or rigorous mental training, one can achieve higher levels of perception. Meditation allows access to information that is usually blocked; talk to the spirits and see the connections between all things, separate a portion of your consciousness and travel, project your presence, control portions of your innerbody that are usually autonomous. Your mind begins to have control over matter; avoid getting burned, fucus energy in one point of your body to stop a spear from entering the skin, etc. Psychedelics can help achieve altered states of consciousness allowing you to perceive visions and prophecies.
It is possible to trade with or make a packed with entities (like a demon) that have the ability to interact with reality in more than three dimensions. For stronger magic it is possible to subjugate some powerful entities.
It is possible to find favor with God and receive limited authority to act in his name.
It is possible to command the spirits, of matter and things that do not have free will, to obey you. This works if you have enough power or the authority and enough faith.
Basically there is no magic but deeper levels of understanding on how to manipulate reality perceived from multiple dimensions.