To get the classic foam on top of an espresso martini, it is important to use freshly brewed espresso (rather than coffee or cold brew) and to shake the shots very well in a cocktail shaker.