This question already has an answer here:
I am new to blender and don’t know much. Here is my nodes. I took a 2D cooffee foam texture from google and created a normal map at https://cpetry.github.io/NormalMap-Online/.
But i'm sure that there is an option to create more realistic foam.