More or less the same way as keeping track of a wallet and keys. Always try to keep them together and in the same place. Give yourself a mental patdown anytime you leave home/work or get into the car to minimize time between absentmindedly putting them down where you shouldn't have.
For me, they go in the same spot just inside the door when arriving home and returned there if I use them at home. At work, they're always on my monitor stand. Before I walk out the door or get into the car, I do a mental check: Watch, phone, AirPods, keys, wallet.
Now that's not 100% reliable, because everyone gets distracted periodically even if they have built good habits. To protect them from tragedy such as a trip through the washer, I make certain I've placed the AirPods on their charger before doing laundry. This requires me to locate them (and scold myself if they're not in their spot by the door) before running the washer.
If I'm going somewhere like camping, backpacking, or traveling for work, I have a designated bag and zippered pocket in that bag where the AirPods are stored when not in use.