Having a difficult time understand sizes and which units to use

I really struggle with what values to put on the padding property? Also I don't know when I should use rems or pixels.
I guess this comes from coding instructors online just throwing out numbers without explaining why. Any tips?
Was this page helpful?