First, set up your "box" with the appropriate outcomes and probabilities. Then find the random number generator tool in Excel (or whatever software you use).
This example is the "cereal" box from your book using the numbering scheme at the bottom of p. 138. You can generate your own "random number table" or your own "simulation". If you wanted to purchase 1000 boxes…you could do it the following way (next page)
The "number of variables" could represent the number of boxes you bought in any given shopping trip, the number of random numbers is the number of times you went shopping. This particular example will generate a 1,000 random numbers, 100 trips with 10 boxes purchased each trip:
Note: this could also be used to represent rolls of a die.
The outcome:

With a slight modification, you could simulate a coin toss or any other process that has only two outcomes (yes/no, right/wrong) which are equally likely:

The outcome of the coin toss example:

And note, it doesn't need to be 50-50, suppose you had a biased coin or some two outcome process that occurs 70-30:
