Why is it when someone is cooking something, like a cookies or pizza, you can smell it all the way upstairs? like does it have to do with diffusion or something? I'm confused...Thanks in advance :)

Diffusion, yes.

Diffusion describes the spread of particles through random motion from regions of higher concentration to regions of lower concentration.