How do I keep track of how old food is? I've been paying more attention to food safety but I don't understand how people remember exactly how long a given item has been sitting in the fridge.

If I want to make sure to stay safe, do I have to just write down what I bought/cooked/took out of the freezer and when? I have started doing that but I never used to and doubt that most people do that. Or do I just label everything?
Label everything with the date it goes in the fridge. That's about all there is to it. In my house we keep a marker and a roll of painter's tape in a drawer near the fridge, which makes labeling food easy; then you just stick to the system, religiously.

Incidentally, if it's not instantly obvious what's in a container (e.g., you have a container with opaque sides, or similar-looking substances like gravy and soup), put that information on the label as well.