First, be thankful you did not spill coffee on the laptop.
Second, coffee is not clear water and can leave a residue.
Third, carefully clean everything (including around keys) with a slightly wetter than damp cloth so there is no sign of residue anywhere.
It may not be feasible to disassemble a consumer keyboard, but if you can, you can do a deeper cleaning. I am not sure about the feasibility of this.
Fourth, allow to dry at least 8 hours.
Now try the external keyboard and mouse.
Certainly, be prepared to replace. I would replace them.