What I mean is, I know that if a play has four spell slots of level 1, they can cast four level 1 spells and no more. But what I am confused about is does a player have to specify if they want, for example, two Cure Wounds spells and two Detect Magic spells? Or can they just say "I have prepared Detect Magic and Cure Wounds" and then cast how many they want until their spell slots are expended?
TL;DR - yes you pick and choose spells on the fly
From the Basic Rules entry for the Wizard:
The Wizard table shows 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.
You prepare the list of Wizard spells that are available for you to cast from your spellbook. Choose a number of Wizard spells from your spellbook equal to your Intelligence modifier + your Wizard level (minimum of one spell). The spells must be of a level for which you have spell slots.
For example, if you’re a 3rd-level Wizard, you have four 1st-level and two 2nd-level spell slots. With an Intelligence of 16, your list of prepared spells can include six spells of 1st or 2nd level, in any combination, chosen from your spellbook. If you prepare the 1st-level spell Magic Missile, you can cast it using a 1st-level or a 2nd-level slot. Casting the spell doesn’t remove it from your list of prepared spells.
You can change your list of prepared spells when you finish a long rest. Preparing a new list of Wizard spells requires time spent studying: at least 1 minute per spell level for each spell on your list.
So you prepare a number of spells every day equal to your spellcasting modifier + you spellcasting class level. Then you can cast those spells out of whatever slots you have, in any combination you choose.
Effectively, at the start of the day, you choose the list of spells you can cast that day. Then you can cast them out of whatever spell slots you choose.
If you have 4 level 1 spell slots, and Detect Magic and Cure Wounds prepared, you can cast 4 Detect Magic spells, 3 Detect Magic and 1 Cure Wounds, 2 Detect Magic and 2 Cure Wounds, 1 Detect Magic and 3 Cure Wounds, or 4 Cure Wounds spells.