The core gimmick of King's Quest 3 is, of course, the magic spells that Gwydion must create to complete his quest. The instructions for creating these spells, which originally appeared in the KQ3 documentation, are here.
To begin casting a spell, approach Mannannan's spell book (you did find it, right?) and type "TURN TO PAGE #", where # is the roman numeral of the page for the spell you wish to work on.
WARNING: As any King's Quest fan will tell you, the KQ3 spellcasting system is by far the single most unforgiving CP scheme ever devised. You must have ALL the ingredients and tools needed before you begin (you can't leave mid-spell), and you must follow the directions EXACTLY. Even a single erronious word will result in your immediate (though quite funny) demise. SAVE BEFORE ATTEMPTING.