Debugging Home Assistant through an IDE

I need some help debugging Home Assistant through an IDE. Any help/resource would be much appreciable.

As of now I use PyCharm CE IDE , and for running HASS i am using Linux Environment, and I do not see a way to debug my custom components or automations etc, through the linux console.
Is there a way we can debug through an IDE ?

I am looking for a detailed answer on this, so that I can get started.

Thanks

I know there is an addon for Hassio that displays the home assistant log on a web page. If you are running just Home Assistant it can likely be added too.

Are you running Hassio or Home Assistant / Hassbian?