Often when your carpets have been flooded they will need to be replaced. Underneath the carpet there is what they call “under lay”. In most cases this will also need to be replaced.
Flooded carpet can sometimes be pulled up, dryed out and re-used. But it’s expensive to have a carpet layer do this and often better to just replace the carpets if you can afford it.
Your carpets will need to be steam cleaned if they’ve been flooded to get rid of the smell and make them clean again. If the carpets are ruined from the water, your carpet cleaning company should advise you and then you should have them replaced.