Inhaling essential oils in moderation is perfectly safe and okay however if you do inhale too much essential oils then it could become harmful.
Essential oils can also get you high if you inhale the essential oils too often.
But every once in awhile and just inhaling a bit of essential oils is not harmful and can help improve your memory and can even help you fall asleep.
Using an essential oil diffuser to diffuse the essential oils is a much safer option since most of the essential oils are spread through the air and evaporates making the essential oils safer to inhale when it comes out of a diffuser.