Guppies do not lay eggs. They are live-bearers, meaning that the female retains the fertilized eggs within her body until the fry (baby fish) are mature enough to be hatched and live independently.
Guppies are among the easiest aquarium fish to breed. Many fanciers use a breeding trap within a community tank to isolate a pregnant female when she is ready to give birth. Since larger fish cannot enter the trap, the fry are safe once their mother is removed. Another technique is to provide numerous hiding places for the fry in the community tank, usually in plantings of aquarium plants. Some will be eaten by adult fish, but there will almost always be a few survivors.