The visit comes just one day after Lovato was found unconscious in her Hollywood Hills, California, home by police and first responders.
A source at the hospital tells PEOPLE Valderrama visited with Lovato late Wednesday. The singer, 25, remains at Cedars-Sinai and is staying in the hospital overnight, the source also confirmed.
Valderrama rushed to Lovato’s side after initially being very “shocked” by his ex’s overdose.
“He knew she was going through a tough time but he wasn’t prepared for this,” a source close to the former couple told PEOPLE on Tuesday. “He saw her through so many ups and downs and was her rock through some of her darkest moments. To see her back in such a sad and vulnerable place is heartbreaking for him.”
The insider added the actor has “always cared deeply for her and they truly remained friends after they broke up.”
“Demi always hoped they would end up back together in the future,” the source continued. “He’s the love of her life and vice versa.”
The former couple dated for six years before announcing their split on Instagram in June 2016 in a joint statement.
In February a source close to the two told PEOPLE they were “super, super close and have a crazy love for each other.”
“They’re extremely close friends but there’s always potential they could give a romantic relationship another try,” the source said.
The insider added that Lovato is “very vocal about the fact that he is the love of her life. A lot of their issues had to do with their age difference, but she’s matured a lot even in the past year or so. At first, it was really fun for her to be single and date around, but now she’s starting to see that the grass isn’t always greener.”
Last fall, Lovato opened up about her relationship with the actor saying she “never loved anybody like I loved Wilmer.”
The pop star’s apparent overdose came after a night out with friends, a source confirms.
“She and her ‘friends’ were on a binger the entire night,” an insider told PEOPLE early Wednesday. “They keep Narcan on hand for such situations – they were prepared for this. The people she has been hanging around lately aren’t her real friends – they don’t have her best interests at heart. She’s pushed her true friends away.”
The source added, “She had to find creative and sneaky ways to get drugs because her team and those that really care about her really try to keep a close watch on her.”
And while the insider says Lovato is “capable” of pulling through this, sources close to the star told PEOPLE they had been fearing an incident like this for an extended period of time.
RELATED VIDEO: Demi Lovato Is ‘Awake and With Her Family’ In Hospital Following Apparent Overdose: Source
“Things have been a total mess for months. She and her team severed ties, and they played a large part in getting her sober years ago. She hasn’t been in a good place,” a close source claimed.
Last month Lovato released her new hit song, “Sober,” revealing her recent relapse following six years of sobriety. She performed “Sober” in Paso Robles, California, just two days prior to the apparent overdose.
If you or someone you know is in need of help, please contact the SAMHSA substance abuse helpline at 1-800-662-HELP.