Basil is an annual, and like all such plants, flowering can signal the beginning of the end.
But we want our basil to keep making leaves for as long as possible for cooking all summer long. Flower production changes the plant from vegetative growth (leaves) to reproductive growth (seeds). We prune off our garden flowers the moment they fade so new ones form, otherwise going to seed makes them slow, and soon they'll stop altogether. Same applies to basil and cilantro, another annual that's popular in summertime seasoning gardens.
So the moment the flower bud starts, nip it off, and keep feeding and watering generously so the vegetative growth continues unhindered by brief drought or insufficient moisture. Check them each day and do the deed for all the fresh pesto your want well into the fall!