In a saucepan on medium-high, heat milk and coffee beans until just boiling. Or, if using butter, melt butter and then add coffee beans.
Lower heat so the beans and milk/butter come to a simmer.
Simmer for five minutes.
Remove from heat and cover. Let sit for fifteen minutes.
Use a sieve to remove the beans.
Let the milk or butter come to room temperature. If using butter, refrigerate until it is no longer a liquid. or freeze until no longer a liquid (if you need to use it quickly).
Notes
Use more milk or butter than you will need for your recipe. Using 3/4 cup will yield about 1/2 cup.