You can only cast a spell during your main phase, while the storyline is empty. (A few cards like grant a timing exception.)
When you cast a spell, follow this process:
Choose the Spellcaster.
This is often your Avatar, but it can be any Spellcaster you control.
If your Spellcaster occupies multiple locations, choose the location where they're casting the spell. For example, occupies two locations, surface and subsurface; when it casts a spell, you must choose if it's casting from the surface or subsurface location.
Reveal the spell and confirm you have the necessary threshold and mana to cast it. Note: Both players are responsible for confirming that all spells are cast legally! The most common spellcasting mistake is having insufficient threshold. Make it a regular practice to check threshold on every spell that's cast!
Choose additional details based on the type of spell. See below.
Once you've done those three steps, you actually pay the cost to cast the spell and the card moves from where it was (usually your hand) and enters the storyline. It will then resolve according to the normal storyline rules.