To keep walnuts fresh, store them in an airtight container in a cool, dark place, such as the refrigerator or freezer. This will help preserve their flavor and prevent them from turning rancid.