Magic is a brand new skill added in the Realm of Magic game pack for The Sims 4, and you can level up this skill just like any other skill in the game. Leveling up the magic skill allows you to learn new and more powerful spells, as well as giving you skill points to unlock various magic related perks.
There are several methods to increasing your magic rank. One of the easiest ones is to Practice magic. This is really easy because you can just click on your sim, select the magic menu, and click on "Practice Magic", and you sim can do this at any point anywhere.
Another method that is a bit faster is to go to the Magic Realm and find another spellcaster. Click on them and choose to duel them. You can fight the other spellcaster, and you will get a certain amount of experience towards your magic rank. You get this experience even if you lose the battle.
Just like all other skills in The Sims 4, you can learn it by reading a book from a bookcase, or by talking about it with a more skilled spellcaster. So find a skilled sim in the Realm of Magic, and this sim can teach you a few nice things that will give increase your Magic Rank.
The last and final method to leveling up your Magic Rank is to interact with Cauldrons. These can either be experimented on, or brewed with. Both options will give you skill rank.
And that's all there is to increasing your Magic Rank in The Sims 4: Realm of Magic. Just do any of these things over and over, and you will reach Rank 10 before you know it. Good luck!