A statement released by his family wrote, "Our beloved Tim was a seeker, a fragile artistic soul searching for answers to existential questions. An over-achieving perfectionist who traveled and worked hard at a pace that led to extreme stress," the statement reads. "When he stopped touring, he wanted to find a balance in life to be happy and be able to do what he loved most – music. He really struggled with thoughts about Meaning, Life, Happiness. He could not go on any longer. He wanted to find peace."
According to online resources, throughout his career, Avicii dealt with numerous health problems, including acute pancreatitis, in part due to excessive drinking. In 2014, he had surgery to remove his gallbladder and appendix. These issues eventually led Avicii to retire from touring in 2016, though he continued to make new music.
We can only speculate the potential reasons he committed suicide but we won't know what it is for certain.
I read online that his family started a charity to raise awareness for suicide and mental health.
Tim was a great artist, I've always loved his music.