This feels like a dumb question, but does casting spells out of combat (like if someone used detect magic) use up spell slots? I would assume it does but I wanted to check in case.
Yes, they do.
As described in the basic rules for spellcasting:
When a character casts a spell, he or she expends a slot of that spell's level or higher, effectively "filling" a slot with the spell.
There are no exceptions noted here about being in or out of combat.
However, some spells in 5th edition can be cast as a ritual, in which case it takes an extra 10 minutes to cast but doesn't use the spell slot. For example, identify normally takes 1 minute to cast, but if you spend 11 minutes it doesn't use a spell slot.
Detect magic normally takes 1 action (6 seconds) but it can also be cast as a ritual. It takes 10 minutes and 6 seconds to cast, but then you don't use the spell slot.
Note that not all spellcasters can cast spells as a ritual, only those with the Ritual Casting feature. There are also some other sources for ritual casting, such as the warlock's Book of Ancient Secrets eldritch invocation and the Ritual Caster feat.