Melt the butter in a 2 qt. saucepan over medium-high heat. Whisk together the sugar, cocoa and flour in a bowl; add to the melted butter, whisk. Slowly add milk, whisking constantly until smooth. Bring to a simmer, cook until thick 2-3 minutes. Whisk in vanilla.