All plants flower and go to seed, so it's not unexpected for your coriander to do the same. Coriander is an annual, which means it grows from seed, flowers and then produces its own seeds all in the same year.
Given that your coriander has already gone to seed means it's too late to do anything now. It'll soon die, but you can collect the seed and try again with its offspring - or maybe even buy new seeds.
A lot of plants flower and set seed early if they don't have enough nutrients, water or sunlight, in the hope that their offspring will get a better chance. A rich soil encourages young, fresh, leafy growth in most plants, so this could help keep your new plants and keep them from setting seed - or bolting, as you call it when a crop such as herbs or vegetables set seed.
You may even get seeds of coriander varieties that are less likely to bolt (some are actually called bolthardy).
I hope this helps and you have better luck next time.
Good luck with it ....