Why does coffee make me pee?
Coffee — specifically the caffeine — is a stimulant. Stimulants are a class of chemical/drug that give you energy (“uppers”). You may be familiar with some of the other things they do like make your pupils larger, make your heart beat faster, raise your blood pressure, etc.
It turns out your body does not like your blood pressure elevated significantly above normal for a prolonged period of time. It can do bad things over time like cause an aneurysm (a balloon-like bulging in your blood vessels can rupture, which can essentially be fatal even with rapid medical attention), stroke, kidney damage, dementia, etc. Your body has three mechanisms to lower your blood pressure. One is to widen your blood vessels (vasodilation), one is to slow your heart rate, and another is to get rid of the fluid in them. Your body uses the latter to counteract caffeine.
The body uses sodium ions to retain water/fluid within its blood vessels. When you purge the salt, water/fluid follows. Caffeine stops the kidneys from holding on to salt causing it to be expelled into urine with water following soon thereafter.