It is the first time the singer has spoken about the 26-year-old’s death.
In a moving post on Instagram, Ms Grande apologised to her ex-partner for not being able to “take away” his pain.
She wrote: “I adored you from the day I met you when I was nineteen and I always will. I can’t believe you aren’t here anymore.
“I really can’t wrap my head around it. We talked about this. So many times. I’m so mad, I’m so sad, I don’t know what to do.
“You were my dearest friend. For so long. Above anything else. I’m so sorry I couldn’t fix or take your pain away.
“I really wanted to. The kindest, sweetest soul with demons he never deserved. I hope you’re okay now. Rest.”
Ms Grande posted a video she had filmed of Miller to accompany the message.
Mac Miller’s friend previously said Ariana Grande was “incredible” in supporting the rapper’s sobriety.
Shane Powers opened up on his podcast, The Shane Show, about the death of his friend, saying no one could have been “more supportive” than the God Is A Woman singer.
Powers said: “He had a lot of good stuff going on. Ariana and him were together and they were very much in love and I have to say, she was incredible when he was first sobering up.”
Miller was found unresponsive at his California home on Friday morning following a reported overdose at the age of 26.