I am a level 4 cleric with a 20 (+5) wisdom in D&D 5e. This means I have a total of 9 spells I can cast in 1 day. I only have 4 level 1 spell slots and 3 level 2. So if I were to use all those spell slots in one day what would happen to the extra 2 spells I can cast? Can I not use all 9 spells I have available for me to cast?
There is a big difference between 'Spells Prepared for the Day' and 'Spell Slots.'
- The spells you prepare is the library of options you have to pick from when you go to cast a spell.
- A Spell Slot is the 'fuel' that makes a spell work.
So, when you want to cast a spell, you pick any spell you want from your prepared 'library', pair it up with an appropriately powerful spell slot to fuel it, and then cast it. If you need to, you can have 9 spells prepared, but expend all of your spell slots casting the same spell over and over again.
But, the more spells you are able to prepare, the more options you have for what you choose to cast, when you go to use a Spell Slot. Which means you can be prepared for a broader range of possible circumstances. (Healing spells if someone gets hurt, damage spells to blast someone, utility spells for practicality)
Think of it like this...
You're DJing an event. The event lasts for 1 hour. Averaging 3 minutes to a song, that means you have time to play 20 songs. Now...does that mean that you would only brings exactly 20 songs with you to play? Well, no....the more songs you bring with you, the more options you have...and the more likely you are to have the song you 'need' when someone comes up with a request for a song.
But, even if you bring 5 hundred different songs with you, you still only have time to play 20 of them. It's the same thing. You have a library of 500 songs, but only 'slots' to play 20 of them.
In a nutshell:
Yes, you can prepare more spells than you can cast per day. This gives you situational flexibility; you prepare spells for what you think you might face, and you don't have to get that exactly right. You can have Find Traps in your pocket, just in case you get to a suspicious area, and if you don't, that's fine — you haven't wasted any of your daily resources.
Don't forget rituals!
As a cleric, you have the Ritual Casting feature. This let you cast a spell you have prepared which has the "ritual tag" without using a spell slot, provided you spend an extra ten minutes to do so.
You can have incredibly useful ritual spells like Purify Food and Drink prepared and be useful to your party without significantly diminishing your combat and healing effectiveness.
Not a nut, but an onion....
1. The universe of spells.
At the outer layer, we have all the 5E D&D spells in the universe, from all the supplements and everything. And throw in third-party options from DM's Guild or other publishers, or for that matter random websites or things you've made up.
2. Allowed options.
One layer in: your DM may let you use Unearthed Arcana web-based playtest material. Or not. Maybe the campaign is limited to just the Basic Rules, or just the Player's Handbook — or maybe you can use spells from Xanathar's Guide. If third-party options are allowed, it's almost certainly on a case-by-case basis. (Not all of that infinity is high quality, but it's not just that. Sometimes certain spells and options aren't thematically appropriate for a given game world and campaign.)
3a. Spells known.
Then: of those allowed spells, which are available to your character? This varies by class. For clerics (and druids and paladins), this is simple: you have access to everything on the spell list for the class — which is to say, it's the same as the layer up.
But for most spellcasting classes — sorcerers, rangers, warlocks, bards, and fighters and rogues with spellcasting subclasses — you have a limited list of Spells Known, which increases as you level up. This list is a subset of the layer above.
Generally in these classes, the level of your known spells is limited to the spell slots you have available. If your highest-level spell slots are 2nd-level, you can't learn 3rd-level spells. However, these classes also all let you swap out one lower-level spell for a higher-level one each time you gain a level.
3b. Spells prepared.
The classes which don't have a limit to spells known (cleric, druid, paladin) do have a layer of restriction, though: that's preparing spells. It's really the same sort of restriction as spells known, except you can change it every day. For the full caster classes, the number is equal to your spellcasting modifier plus class level; for paladins, it's plus half-level.
You can prepare any number of spells for any spell slot level you have available. A 5th-level cleric has two 3rd-level spell slots, along with three 2nd and four 1st. If you have a Wisdom of 18 at that level, you could prepare nine 3rd-level spells and no 1st- or 2nd-level, even though that's probably silly.
Also note that some class features, like Circle Spells for Circle of the Land druids and Domain Spells for clerics, count as always prepared — they're kind of like "spells known" in this sense, but it's important to note for features that work on prepared spells that they are more like automatic picks which don't count against the regular total.
In your case, as a 4th level cleric, you have four additional spells prepared in this way: two 1st-level and two 2nd-level domain spells are always prepared. These don't count against the normal limit of cleric level plus spellcasting modifier (Wisdom, for clerics; +5 in your example).
3c. Wizards and spellbooks.
Wizards are unique because of the spellbook feature. They don't have a "spells known" limit, but they also don't have direct access to the universe of wizard spells automatically. Instead, they have a spellbook, to which they add new spells as they level up, and which can be added to by copying in spells found in scrolls or other books while adventuring.
This means that in theory, wizards can have an unlimited list, but in practice, there's a finite selection from which they can prepare spells to actually cast.
So, really, wizards have two layers here: 3c-i, the spells in the book, and 3c-ii, the spells chosen from that book to prepare for actual use. This is a big restriction compared to the divine or mystical connection that gives clerics and druids access to the universe's complete lists to prepare from — but in exchange, wizards have the very powerful ability to cast rituals from the spellbook without preparing them.
4. Actually casting the spell.
Here's where the spell slots come in. When you decide to cast a spell, you pick one that you know (for the classes where that's a limit) or have prepared (for the others) for which you have an unspent spell slot, and you cast the spell, spending the slot.
Or you cast as a ritual, without spending slots. But it's gotta be from your prepared list. (Except for wizards, as noted above.) Not every class can cast rituals, though — as a base class feature, it happens to be limited to classes which use spell preparation rather than having limited known spells.
Casting the spell (whether using a spell slot or as a ritual) doesn't remove it from your list of prepared spells — for example, if you have Healing Word in your list for the day, and you have six spell slots, you could cast that six times and ignore all of your other prepared spells.
Each level of the onion narrows down the number of spells available. As a game mechanic, this helps shift some of the decision-making from in the moment of combat to either character creation and leveling (the spells-known classes) or to after each long rest (the prepared-spells classes). That way, when it comes to your turn in the initiative, you're looking at a short list you've already considered, rather than saying "Hey, does anyone have a copy of Xanathar's handy? I want to see what I can do."
As a player with a character who uses prepared spells, I find it helpful to have spell cards, either officially licensed or any of the various homebrew options you can find and print. I flip through these at spell prep time, and pull out the ones I've prepared. The rest go back in the deck. If I had a wizard character, I guess I'd have three piles: available, in the spellbook, and prepared today.
Prepared spells are not expended when you cast them. Rather, you expend spell slots to cast spells. Page 58 of the PHB
The Cleric table show s how many spell slots you have to cast your spells of 1st level and higher. To cast one of these spells, you must expend a slot of the spell’s level or higher. You regain all expended spell slots when you finish a long rest.
For example, if you are a 3rd-level cleric, you have four 1st-level and two 2nd-level spell slots. With a Wisdom of 16, your list of prepared spells can include six spells of 1st or 2nd level, in any combination. If you prepare the 1st-level spell cure wounds, you can cast it using a 1st-level or 2nd-level slot. Casting the spell doesn’t remove it from your list of prepared spells.
So, you can prepare 9 spells. When you cast a spell, pick a spell slot to use. You have 4 level 1 slots and 3 level 2 slots. You can cast any of your 9 spells with those slots, but the 9 you prepared are not expended. You can cast the same spell 7 times if you wish. Remember that some prepared spells have a spell level to them, as such they can only be used with a spell slot equal to or greater than their spell level. If you use a level 2 slot to cast a level 1 spell it may have additional bonuses, but it doesn't have to have those bonuses to cast a lower level spell.
I tend to think of prepared spells as "guns" and spell slots as universal "ammo". Pick the spell gun you want, give it the ammo, and fire away. Once you're out of "ammo" (slots) you only have empty "guns" (spells). Or whatever metaphor works for you.