In order to cast a spell of level x you need a spell slot of at least x in order to cast it.
Your max spell slot level as a full caster can be calculated by adding 1 to your character level then dividing by two.
Hence level 3 spellcasters can cast 2nd level spells, for example.
Another way to figure this out is to open up your Player’s Handbook and look at the Druid class. On the table that shows when you get class features, it also shows you your spell slot progression.
Note: this works a little differently when you are multiclassing
When multiclassing, your maximum spell slots are determined by your effective spellcaster level. This is calculated by adding the number of class levels of full casters (bard, druid, sorcerer, wizard, cleric), number of levels/2 of Half-caster levels (paladin, ranger), and the number of levels/3 of 1/3 casters (trickster, Eldritch knight).
So a character who has cleric 3/druid 5, could prepare up to 2nd level cleric spells and up to 3rd level druid spells. They can cast any of these spells using up to 4th level spell slot. This can be figured out using the Multiclass Spellcaster table in the PHB or by using the formula above: (3 + 5 + 1)/2 = 4.