How do you differentiate Perception and Investigation rolls?

How do you differentiate Perception and Investigation rolls? As a DM I always get confused on what to have my players roll.Perception can be to see/perceive details in the environment via sight/sound that can tip you off to something amiss. Investigation is a thorough inspection/search of a locale to seek information about it and perhaps things hidden throughout. That’s how I do it?