Beer does not require many ingredients. You need water, yeast, malt, and hops. For good beer (not that you'll be picky if civilization ends), you want water with an optimal calcium content and pH. Yeast is a living organism, always present in the air, which converts the sugars from malt or malt extract into alcohol and carbon dioxide. You can ferment alcohol just by waiting for wild yeast to colonize any fruit juice or grain mash, but the results are not likely to be pretty. It's really better to use a strain of yeast that has been proven to be good for brewing. Malt is made from barley, a grain. To make malt, barely is soaked to sprout it, then roasted, and crushed. Hops are the flowering portion of an easy-to-grow vine.
Once you have the ingredients, it takes about 30 days to make beer. First, you need to clean and sanitize your equipment, which requires boiling water. Next, you need to boil the ingredients and then cool them down. The time and temperature of cooking and the rate of cooling all impact the quality of the final product. The actual brewing only takes 9-10 hours, but the fermentation and aging can take 20-35 days, depending on whether you are making an ale or a lager.
So, if you find yourself in a situation where no more beer is going to be made commercially, your best bet is to stockpile supplies, get the ingredients to start making your own brew, and break out the gardening gloves. Brewing is a straightforward process, but not all beers are good! The exact recipe and origin of the ingredients and the timing of the brewing result in the distinctive tastes of different beers. Now you know!