You can assume the hardware (coin slot, motor, display) exposes simple methods.
Think about what happens when something goes wrong halfway.
State pattern
An object changes its behaviour when its internal state changes; each state is a class.
State transition
A move from one state to another caused by an event, such as Idle to HasMoney when a coin is inserted.
Greedy change
Return the largest coin that fits, repeatedly. Works for common currencies.
Lost update
Two writers read the same value and one overwrites the other's change.
Offline-first
The device works fully without a connection and syncs later.
Decisions you confirm will collect here as you go.