I have had a iPhone 7 Plus in the past that had water damage and a similar problem of frequently shutting off and the home button not working. I would recommend fully shutting down the iPhone, removing the SIM card tray, and leaving it in an open air environment to dry out for about a week or two. This usually dries out the components and I was able to get the iPhone to stop restarting and get the home button working again. You could try to blow dry the phone on a low heat setting, but this should be a last resort. Rice and silica packs do not work very well for liquid damage.