Readers forgive almost anything in a fantasy world except cheating. If a magic system solves problems the author cannot, the story collapses. These are the rules I follow.
First, give magic a cost, and make the cost interesting. In The Lanternkeepers, every light a mage kindles burns a memory. Power is never free, so choices have weight.
Second, limit it before you expand it. A short list of things magic cannot do makes the things it can do feel precise.
Third, let the rules create the plot. The best moments come when a character uses a known limit in a way the reader did not expect, and the reader can trace it back to a rule you planted earlier.
Fourth, show the ordinary use. If magic lights streets and bakes bread, the world feels lived in.
What's a magic system you thought was done well, and what made it work?