Detect a Hidden Foe
Use your sight, hearing, or even sense of smell to detect the presence of lurking enemies. See examples.
If a perception check is called for, remember that:
Poor lighting, fog, and other obstructions may give you disadvantage.
Moving at a fast pace can give you disadvantage.
Natural obstructions may limit how far you can see.
See DMG 244 for Tracking DCs.
Passive Perception. Even if you are not actively searching, the GM can determine whether you detect the presence of a hidden enemy in passing through use of a passive Wisdom (Perception) check. See the example.