Suppose you choose ashtray 1 ( you can try it with the others its he same ) here are the possibilities :-
ashtay 1 ashtray 2 ashtray 3 result if switching result if staying
coin nothing nothing lose win
nothing coin nothing win lose
nothing nothing coin win lose
If you switch you win in 2 out of the 3 combinations
If you dont switch you win in 1 of the 3 combinations
It only works if the barman knows which you chose, and where the coin is, when he removes an empty ashtay.