このボタンを押すと、コーヒーが出てきます。

The particle と can be used to show that when one event happens, another follows after as a consequence.

このボタンを押すと、コーヒーが出てきます。
If you press this button, then the coffee will come out.

まっすぐ行くと、駅につきます。
If you go straight ahead, then you’ll get to the station

Note, this particle is used when the second predicate is the natural consequence of the first. It cannot show any instruction or volition, so cannot end ましょう, ください, したい, etc.

There is a good page in Tofugu for this.