Cannon Reagan consider this a supplement to the excellent answer by @hellomacos . First off skip the rice. It is absolutely useless. It will not help you fix your phone. All it does it provides a false sense of security. It will not clean your phone, it will not prevent corrosion.
For now you want to stop continuing to try to charge, sync or otherwise use your phone. This potentially can make a bad situation worse.
The very first step I would take is to disassemble your phone. Use iPhone XR Repair - iFixit to disassemble your phone. Take a careful and close look at all components and connectors. Truly assess the damage. Look for major corrosion, evaluate the pins in the connectors etc,. Take a look at all connectors as well as cable ends. After that I would suggest that you clean it a couple of times in sterile water, not drinking water. Use a soft brush and clean it very, very thoroughly with the sterile water. Once you got the gross contamination cleaned, use 90%+ isopropyl alcohol and clean your parts some more. You must remove the EMI shields since they create a "hiding spot" for corrosion etc. For a proper cleaning, use this guide. It was written for an Apple iPhone 3G but it is still pertinent to your phone as well. I can not stress the importance of a good cleaning enough, so do it over and over while replacing the alcohol after each cleaning. Do not use compressed air for the cleaning since that can drive liquid as well as corrosion particles into areas that will cause trouble later on. Do not use drinking water, if you need to use water, use sterile water. Also, you do not need to leave it to dry after the cleaning. Isopropyl alcohol in the higher concentration will evaporate quickly and dissipate the water. The importance here is the cleaning. The best cleaning would be by ultrasonic cleaner but if not available, this will at least help. After that you must replace the battery. This is a must and not optional. It will fail if you do not take care of it now. Once all of this is done, reassemble and re-evaluate. Keep in mind that water damage is the hardest to troubleshoot and to repair. If you run into things you need some clarification with, post some images of what you find with your QUESTION. Hope this helps, good luck.
Adding images to an existing question - iFixit Repair Guide