Hello *Please read all before doing anything to the laptop*
Liquid damage on laptops is extremely damaging because the entire motherboard or in this case, the logic board, is located directly underneath the keyboard. With only the keyboard to protect it on top, there are many gaps in it thus leaving coffee and water to get underneath rather easily and quite quickly. In this case, we have coffee. If the coffee had any type of sugar, milk, or flavoring inside of it… Then we have a slightly worse problem. Sugar, milk, or flavoring causes even more damage to logic boards on laptops than compared to water. On top of that, sugar tends to stay on a surface if it wasn’t sanitized as simply drying will do nothing.
One thing I would recommend is to remove the motherboard and get 99% isopropyl alcohol, then use that to prepare an isopropyl alcohol bath for the motherboard. You want to try and get the sticky sugar residue that was left behind off of the motherboard. I HIGHLY recommend doing your research before doing so as the type of bath, timing, and cleaning all depend on the type of motherboard. You can clean off these sticky surfaces by gently cleaning it with 99% isopropyl and a toothbrush as well. I will mention that if you are going to do this, then you will need to purchase a new thermal paste for the logic board as you will have to reassemble it later on. MacBook Pro 15" Touch Bar Late 2016 Thermal Paste Replacement
The reason I would clean the motherboard is that corrosion of the motherboard can cause some components to not work. Everything else might still work correctly now, but later on, other components will begin to fail if not given proper cleaning and care. If you still want to only replace the power button, then there are a couple of good guides on youtube that you can use to follow along with. Compressed air will probably not work when it comes to liquid damage. Removing corrosion and the liquid residue is the best thing you could do to repair it.
Finally, I want to mention that replacing the power button may make you lose touch ID functionality. It is noted in the teardown of this laptop that the power switch is paired to the logic board at the birth of the laptop. Replacing the power button can be done, but regaining touch ID requires help from Apple.
Sorry, it got so long, I wanted to inform you of the many different issues that could be causing this. Hope this helps!