Joe Jonas turned to music as an ‘outlet’ amid his darkest times