The best way to do this is by deadheading. By taking off the dead flower heads the plant will put it’s energy into making more flowers. If the dead heads are left on, the plant will put its energy into trying to form seeds.