Adding an MQTT Device to Home Assistant Beginners

How to configure MQTT devices in home assistant by editing the configuration.yaml file and also by sending configuration data as an MQTT payload