Recipe is for 24 pieces, and required quantity is 16.
So the ratio is 16/24 = 2/3 means we need to reduce all ingredients to 2/3 of the given quantities. Not all recipes can be reduced prorata, but we will assume it can be done. A word of caution: the measurement of quantities will become awkward (like 3/8 of a teaspoon of salt, etc). The practical way is to make the full recipe, and invite friends to take home the remainder.
Here's the scaled recipe
Butter 1cup*3/4 = 3/4 cup
unsweetened chocolate = 4*3/4 = 3 squares
white sugar = 2 * 3/4 = 1 1/2 cups
eggs = 4 * 3/4 = 3 eggs
A.P. flour = 1 cup * 3/4 = 3/4 cups
vanilla extract = 1 * 3/4 = 3/4 teaspoons
salt = 1/2 * 3/4 = 3/8 teaspoons
chopped walnuts = 2 * 3/4 = 1 1/2 cups
For this reason, there is a trend to use weights (in grams) than volumes to make scaling recipes easier.