How to fix a Galaxy S9 that keeps restarting and asking for PIN

How to fix a water damaged Galaxy A5: won’t turn on after it got wet