how assign prefab from assets to variable

This is my variable to which I can assign one of my 20 prefabs from assets, in order to play a specific animation.

public GameObject _spell;

I would like to assign via script a certain animation. For example, if my player picks up a “spell_Fire” PickUp, I would like Unity to dynamically assign the firespell prefab to my _spell variable.

You will still need a reference to the spell prefabs using the drag and drop method just so your script knows of them. But you can assign your variables a new type of spell or the different types by instantiating new ones.

Have a look at this documentation.

e.g

public GameObject fireSpell;(assign prefab in inspector)
...
MySpell = Instantiate(fireSpell, transform.position, transform.rotation);