Three things to read:
Layout of State Variables in Storagearrow-up-right
Layout in Memoryarrow-up-right
Layout of Calldataarrow-up-right
We have worked through it in the "Ethereum and Solidity Deep Dive" section:
Last updated 2 years ago