Strictly speaking, if one forgot to set aside an eruv tavshilin, he is not permitted to prepare anything on yom tov for Shabbat. Luckily, however, there is some leeway.

When a person sets aside his own eruv tavshilin, he is allowed to stipulate that this eruv is also on behalf of all the Jews who live in the vicinity, so that they too will be permitted to cook on yom tov for use on Shabbat—even if they did not set aside their own eruv tavshilin.

And in fact, it is common practice for the rabbi of every community1 to do just that—to include all the Jewish members of the neighborhood in his personal eruv.2

This, however, does not absolve the city's inhabitants from making their own eruvs. This is a loophole to be employed only by individuals who due to their preoccupation on the day before yom tov had forgotten to make their own eruv3—not for people who were negligent or purposely did not set aside their own.

If one forgot to set aside an eruv before a two-day holiday that falls on Thursday and Friday, an eruv can still be set aside on Thursday—though the procedure is different. Consult with your rabbi if you find yourself in this situation.