Gather all ingredients.
Whisk sugar, cocoa, and flour in a medium bowl until no lumps remain.
Pour in milk and whisk until well combined.
Transfer mixture to a saucepan; cook and stir over medium heat until it thickens to a gravy consistency, 7 to 10 minutes.
Remove from heat; stir in butter and vanilla.
Serve warm.
