The thalamus is located between the cerebal cortex and the midbrain. The job of the thalamus is to process sensory information and send it to the right part of the cortex
This is why we are disgusted when we smell rotten food. Or we miss someone when we smell a certain type of perfume.
For example, I used to spend every summer in Iowa with my mom (My parents are divorced and she lives there). Sometimes when I walk outside and the conditions are just right, the smell in the air reminds me of Iowa. When I catch that smell, I'm almost taken back there. I start to feel multiple emotions. I'm happy because it feels like home and I'm also sad because I miss my home. All of those emotions are triggered by a smell in the air.