From songwriter to singer, Julia Michaels put her pain to paper