If your basil has started flowering and you want to collect seeds for next year allow them to continue flowering. On the other hand, if your intention wasn't to collect seed pinch of a few of the flowers (when young ) and if they're not bitter you can add them to salads, soups or use them as a garnish. Yes, basil flowers are edible too.
Pinching Basil Flowers in Herb Garden
Once basil flowers the leaves tend to taste a little bitter. If you're growing basil in your herb garden on way to extend the plant is to deadhead the flowers. To do this simply pinch off the blooms with your thumb and index finger.