Detect Evil and Good

From Player's Handbook, page 231.

Description
1st-level divination


 * Casting Time: 1 action
 * Range: Self
 * Components: V, S
 * Duration: Concentration, up to 10 minutes

For the duration, you know if there is an aberration, celestial, elemental, fey, fiend, or undead within 30 feet of you, as well as where the creature is located. Similarly, you know if there is a place or object within 30 feet of you that has been magically consecrated or desecrated.

The spell can penetrate most barriers, but it is blocked by 1 foot of stone, 1 inch of common metal, a thin sheet of lead, or 3 feet of wood or dirt.

Learned By

 * Classes: Cleric, Paladin
 * Subclasses: Sorcerer (Divine Soul), Warlock (The Genie), Wizard (Theurgy)
 * Races: Mark of Detection Half-elf
 * Feats: Fey Touched, Magic Initiate, Strixhaven Initiate