I just tried. It is surprisingly easy, and I would totally recommend it even if you have only 4 hours between flights.
I will suppose that like almost everyone coming from an international flight you are at Terminal 3. From the arrivals, go down to the ground floor, where the local buses are, and walk to the right:

After the last bus stop there is still a sidewalk, keep walking. Fortunately this road not too busy as most vehicles use a different, larger road. Sometimes there is an entrance going to the right with a security guard, just ignore it and keep walking. The security guards are here to prevent you from entering the VIP parking areas on the right, they are not here to prevent people from using the sidewalk:

Continuing on the same sidewalk, on your right you will see a motorcycles parking, then a park with a lake. Immediately after the lake, turn right (leaving Yijing Road and entering Erwei Road):

Continue on this road until the next crossroad:

On the left side of the picture above, you can see a few parked scooters, they are delivery scooters parked in front of 美食城. Cross the road and enter 美食城, it is a food court with 20 small restaurants providing all sorts of local foods (soup, noodles, dumplings, drinks, etc), at a third the price of any restaurant you can find in the airport:

If this foodcourt is not to your taste, there are a lot of other restaurants in that same street and in the backstreets of that area.
Summary
- 15 minutes walk from Terminal 3 arrivals
- GPS: 40.04501,116.59858 (OpenStreetMap-based apps such as OsmAnd work fine)

(do not mind Google Maps' wrongful paths and line names on the map above, I just use it for the satellite image)