Ghost Detector
You need to use it on something from the screen below:

without bait:
Misdreavus, Shuppet, Duskull, Dusclops, Yamask, Sinistea, Greavard, Gimmighoul, Gastly, Haunter, Drifloon, Litwick, Lampent, Phantump, Pumpkaboo, Hisuian Zorua, Frillish, Honedge, Doublade, Dreepy, Drakloak, Galarian Corsola, Galarian Yamask
With Ghost Pearl Bait you can find:
Mismagius, Banette, Dusknoir, Cofagrigus, Polteageist, Cursola, Houndstone, Gholdengo, Gengar, Drifblim, Spiritomb, Chandelure, Trevenant, Gourgeist, Mimikyu, Dhelmise, Sableye, Hisuian Zoroark, Jellicent, Aegislash, Dragapult, Runerigus.
Additional baits:
Cursed Horseshoe Bait → +30% chance to find Ghost Pokémon.
Hydreigon’s Incense → Chance to find 1 or 2 additional Pokémon.
Greater Spiritualist Gem → Chance to find Shiny Ghost Pokémon:
Shiny Mismagius, Shiny Dusknoir, Spectrier, Shiny Spectrier, Shiny Greavard, Shiny Houndstone, Shiny Gimmighoul, Shiny Gholdengo, Shiny Spiritomb, Shiny Sableye, Shiny Hisuian Zoroark, Shiny Aegislash, Shiny Mimikyu, Shiny Cofagrigus, Shiny Dragapult
Medium Spiritualist Gem → Only Ghost Pokémon from Kanto, Johto, Hoenn, Sinnoh. Cannot be combined with Greater Gem.
Small Spiritualist Gem → Only Ghost Pokémon from Unova, Kalos, Alola, Galar. Cannot be combined with Greater Gem.
Other versions of similiar system: Bug hunting system, Lava fishing, Ice Mining, Lead Pickaxe, Magnetic Detector.