Unfortunately, there is no magical way to fix water damaged phones by itself. Most of the time people say, "put it into rice" which is true rice great absorbent of humidty however will not be enough. Main board component needs to be opened up and clean with chemicals to stop the corrosions and rust.
Timing is the most important factor if phone waited upon water damage, connectors will be corroded and will be too late to fix. Majority of the water damages can be fixed if it is treated right after water damage while the phone still wet.