In 5e, spell slots are determined by a character’s spellcasting ability score. A character’s spellcasting ability is the highest ability score they have in any class, excluding Intelligence and Wisdom.
For example, a wizard with a Constitution of 14 would have 14 spell slots. A wizard with a Constitution of 12 would have 12 spell slots.
A character can cast any spell they know with a spell slot of the appropriate level. A character can also cast any spell they know at a higher level if they expend a second spell slot to do so.
For example, a wizard with two 3rd-level spell slots could cast either of their 3rd-level spells using one of their two 1st-level spell slots.
A character can’t cast a spell with a level they don’t have access to, even if they have the required ability score and slots. For example, a wizard with 14 Intelligence could not cast spells with levels 1-3 because they do not have that level of intelligence.