Add entity to mqtt device

A lot of searching has led me to this: Manually add MQTT Entities - #7 by 123

But I have to admit, I am struggling. Can anyone link to any other guides on how to publish MQTT discovery messages to add an extra entity to a device?