Come June, Anthony Ramos will be singing and dancing his way through New York City’s Washington Heights neighborhood in the delayed bigscreen adaptation of Lin-Manuel Miranda’s Tony Award-winning musical “In the Heights,” but before then he co-stars as the more stationary Eladio in HBO’s continuation of “In Treatment.”

Eladio is the lone patient of Dr. Brooke Taylor’s (Uzo Aduba) who has to do his therapy sessions virtually, through video conferencing software and phone calls, because he works as an live-in caregiver to a young man named Jeremy who is immunocompromised and can’t risk being exposed to COVID-19. Although at times Ramos is shot by additional “In Treatment” cameras that show off the space around him and the computer he uses to communicate with Brooke, more often his framing is limited to a close-up on his face, the view that Brooke gets during his sessions.

The crazy thing about filming this way, Ramos tells Variety, is that “we were on the same stage. Uzo was in her house on the other part of the stage, and then I was in my room. In between takes I could walk over to see her.”

Although the versatile actor who won a Grammy as part of “Hamilton’s” original Broadway cast is used to being physical on set and on stage, the limited space with which he had to play in “In Treatment” helped him focus on his character work.

“He’s got a lot of dialogue,” Ramos says of Eladio. “I probably had more lines in ‘In Treatment’ than every other project put together. It was, ‘Yo, do your best to stay as true and as honest in the moment and don’t worry about the fact that you can’t move around.’ For me, the most important thing was just focusing on the words — on what he’s saying and what she’s saying, so what he’s thinking when he’s not speaking.”

With this also came with building his posture and mannerisms, which includes the ways in which he keeps a guard up with Brooke in his early sessions. “There’s always that thing where you can close the computer. It’s like people communicating on social media as opposed to in real life: There’s this barrier, almost, which makes it even harder to get through,” he says.

“This guy’s got insomnia, he’s living in a situation with this family and he feels like they treat him unfairly, but it’s a good situation he feels like he can’t leave and it’s almost like he’s gotten complacent,” he continues. “He really doesn’t feel like he can do better, and how many people can relate to that? They feel stuck and don’t know if they can get out of it because maybe they won’t find someone else or another job.”

When Eladio first starts meeting with Brooke, he is reluctant to open up about a lot of his feelings, Ramos admits. (And, while shooting those early episodes, Ramos adds that he didn’t know the full extent of what his character was dealing with because the writers were “still making adjustments” to later scripts and he was receiving them as they went along. “It helped me stay focused and in the moment because in real life we don’t know what we’re going to say next,” he says.) Eladio has been in therapy before, received a diagnosis and is expecting — or perhaps hoping for — a prescription and to be sent on his way. But Brooke is not a psychiatrist and she makes it very clear to him “off the bat she’s not going to give him meds,” Ramos says. Instead, her approach is talk therapy.

“What I think is so important is that in pointing out the difference between the two [is] we’re saying we should give it a shot — talking about it first. And not just once, but really diving in. Yeah it’s work, but it’s worth the work,” Ramos says. “Some people need to take medication for chemical imbalances and things like that, but in shedding a light on the difference between the two [sciences], it’s about trying to really dig in and do the work, and then if you find that nothing is working, maybe go the other route.”

True to the original structure of the first three seasons of “In Treatment” that aired on HBO between 2008 and 2010, the fourth season focuses each episode on a specific patient and allows their story to evolve in half-hour increments, rather than in a few scenes across each of the 24 episodes of the season. During Eladio’s episodes, Ramos says, he will being to open up more, which “speaks to how good Brooke’s character is at what she does.

“He’s like a flower she took the time to care for; she didn’t just throw pesticides on it, she was like, ‘We’re going to water this shit.’ She put the time in,” explains the actor, who has been in therapy for two years. “When you get a good therapist, it’s a blessing.”

“In Treatment” premieres May 23 at 9 p.m. on HBO.