What can someone do if they are sexually stimulated by a dream?
Sexually stimulating dreams (or erotic dreams) are usually referred to as a wet dream because often you end up dripping pre-ejaculate fluid, or even ejaculating semen, while the dream is going on.
There is nothing that needs to be done about the dreams. You can't directly control your dreams. But the reason for the dreams is because all males constantly produce semen in two glands called the seminal vesicles. The seminal vesicles have limited capacity to store semen and semen has a limited shelf life. Ejaculations get rid of the of the older semen to make room for newer batches. Thus, when the seminal vesicles get full, signals are sent that and ejaculation is needed. When you are in the dream stages of sleep, your brain responds to those signals by pulling up images of things it has filed away under "erotic." Your body then joins in by masturbating in your sleep and you end up ejaculating. Things then settle down until the next time the seminal vesicles get full.
When you realize that you had a wet dream, simply take off what you were wearing that got semen on it, rinse it out and put it in clothes that need washing. If you got semen on your sheets, use a damp wash clothe to wipe up the semen or change your sheets with fresh ones and put the old sheets in the wash.