Craig Roberts, Paul Rudd and Selena Gomez in "The Fundamentals of Caring"

On the final day of the Sundance Film Festival earlier this year, Rob Burnett strode out onto the stage at the Grand Theatre in Salt Lake City to introduce his second feature “The Fundamentals of Caring,” with a certain swagger from the knowledge it had played quite well the night before as the festival’s Closing Night Film and the confidence gained from knowing how to work a crowd during the 20 years he was executive producer of “The Late Show with David Letterman.” Yet this was something new for Burnett, whose first film “We Made This Movie” premiered online, and was clearly excited, calling out people from the crowd to share the love like Tom Cavanaugh, the star of his dearly departed TV series “Ed,” who snuck away from his latest job for the occasion.

“[Tom] flew in from Vancouver just to see that — he’s the best guy ever, so [during the Q & A], I was like, “Ladies and gentlemen, from ‘The Flash,’ Tom Cavanagh!” And he stood up, and then my buddy Roger Paradiso, who is just like a businessman, was there, so I was like, “And Roger Paradiso is here also!” Burnett recalls, with a smirk curling up the side of his face. “This guy, you’ve got to know him to love him, but he kind of stands up, and the place went wild. It was the best.”

You couldn’t blame Burnett for relishing the moment since it had been a long time coming. Though he is best known for his work in late night TV, he was first an aspiring screenwriter, a dream deferred when he joined “Late Night at David Letterman” as an assistant during the 1980s and at 29, became the show’s head writer before eventually running Letterman’s entire production company Worldwide Pants. While the Letterman show was always his central focus, Burnett was able to find ways to hone his craft as a storyteller, first in developing shows as a producer such as “Everybody Loves Raymond” to eventually becoming a director on shows he co-created with his partner Jon Beckerman such as “Ed” and “The Knights of Prosperity.”

With “The Fundamentals of Caring,” it’s quite evident how that education has paid off as Burnett deftly handles the story of a man (Paul Rudd) who turns his grieving into a sense of purpose by going into caregiving, while showing the same quick wit and irreverent streak he brought to the “Late Show” in giving Rudd’s Ben a morose, foul-mouthed teen named Trevor (Craig Roberts) with muscular dystrophy as his first patient. An adaptation of Jonathan Evison’s novel “The Revised Fundamentals of Caring,” the comedy follows the pair across the country after Ben becomes convinced that reuniting Trevor with his long-gone father will shake him out of his stupor, eventually joined in their travels by a world-weary yet brassy hitchhiker (Selena Gomez) also revealed to have an absentee dad and an expectant young mother (Megan Ferguson). Opening with the cackle of a baby that you’re not sure is ready to laugh or cry, Burnett keeps the film teetering that line, setting up big punchlines involving Trevor’s fastidious eating habits and landmarks such as the world’s deepest pit as he sneaks in a deeply touching emotional undercurrent about what both Ben and Trevor must go through before they can move on with their lives.

Only a few hours before the film launched globally on Netflix, Burnett and Roberts spoke about hitting that bittersweet tone just right, as well as how the film’s two leads built such strong chemistry and Burnett’s brush with writing for Steven Spielberg.

Craig Roberts and Paul Rudd in "The Fundamentals of Caring"What drew you to this?

Craig Roberts: Work. [laughs] No, it was so well put together. Sometimes you read scripts and you go, “Yeah, this could be good.” But I knew that it would take a lot to fuck this up.

Rob Burnett: God knows I try. [laughs] The novel is beautiful. Jonathan Evison just did such a beautiful job telling such a tragic story in a funny way and ultimately, that is what attracted me to this — to tell a story that is bathed in tragedy, but that can actually get laughs.

Craig Roberts: The beats were all so immaculate, and the main thing is the dialogue is really real and not forced at all, and very funny, but very dark and serious at the same [time], which is the funniest stuff, like “Harold and Maude” is one of my favorite comedies, and that’s so dark, but it’s so fucking funny at the same time. And the character Trevor kind of reminded me a little bit of it.

Rob Burnett: Paul is also a huge weapon in this way, because he’s likable in repose, you know? You feel it, and when you see Paul and Craig together, there’s that line where he comes in [the room] and Craig says, looking at the woman on TV, “Oh, you know if I had one night with her, she wouldn’t be able to walk.” And Paul says, “Oh, because you give her muscular dystrophy?” That’s not easy to pull off, so the combination of Craig saying that, then Paul acknowledging that he enjoyed that, which he did in the movie, saying, “That’s cute.” that enables you to say things that … I don’t think Willem Dafoe would pull that line off. It had a very different feel to it, you know? All due respect to Willem. [laughs] Oh, you’re going to get some angry letter from Willem Dafoe, and that would make it all worthwhile.

In my first meeting with Paul Rudd, I said to him, in most dramedies, the comedy is delightful or amusing, but it doesn’t really make you laugh out loud. But I think we can do this. No one is going to get kicked in the groin, but we can actually produce laughter for an audience. And if you can do that in a movie like this, then the emotional side hits you that much harder because you’re further away from the tears. And I think we’ve done this, which is all a credit to the man next to me, and the guy who wore the Ant-Man suit later on in his life. It’s all the cast, honestly.

Selena Gomez in "The Fundamentals of Caring"Craig, was the chemistry there with Paul from the get-go or did you have to work at it together?

Craig Roberts: We did a chemistry read, which [looking at Rob], I don’t know if you remember, went terribly actually. I don’t think it went very well at all. I didn’t do very well. I came back in the next day.

Rob Burnett: [Craig] and I worked together for like six hours. Paul was in the movie first. And then honestlym we went through 250 actors before we settled on Craig. At the end, we had a bunch come in, and Paul came up from Atlanta where he was already starting to prep “Ant-Man” — ultimately, it would be my decision, but certainly we wouldn’t cast the person without Paul liking them and we have another producer Donna Gigliotti, and there’s an internal momentum with these things. We did chemistry reads with [the actors], and I knew in my heart when I saw Craig — first of all, I loved him in “Submarine” — I knew this was going to be the right thing. But I do remember the first one didn’t go incredibly well…

Craig Roberts: Which was great, because I remember leaving being like, “Hmm. That was interesting.” And [Rob was] like, “Yeah, just come back in [tomorrow].” I think pushed my flight back…

Rob Burnett: “I’m going to pound this into you” — because I knew. And then the second chemistry read with Paul…

Craig Roberts: Yeah, Paul read again, and then you could just feel it click. It’s weird, when you go somewhere like Atlanta to shoot, and you’re removed from everything, it’s so much easier to get on with people because the real world doesn’t really exist. So me and Paul hung out after work and the chemistry just came. He’s a very, very nice guy; very easy to get along with.

Rob Burnett: They also instinctively have a similar sensibility, Paul and Craig, which also is the same sensibility that I have, which is not to lean in and push too hard on things — to just play things real. It’s hard to do this unless both actors are doing it that way because I had that experience with some of the actors that I was auditioning before Craig. Some of them were extremely talented by the way, but I knew that ultimately if they were in the movie, I was going to have to be pulling them back all the time because this material is all very slight. For me, it’s all about giving the actors a chance to be funny. There’s not a lot of “jokes” in the script really. It’s really all about the dynamic of them and how they play off of each other, so this movie relies entirely on the chemistry of these two guys.

Craig Roberts and Selena Gomez in "The Fundamentals of Caring"Was there a different energy once Selena Gomez stepped on set?

Craig Roberts: Less dick jokes.

Rob Burnett: Yeah, Selena adds a real energy to the movie, right when it needs it. When she comes in, and you see Trevor look at that woman — and [Selena] has such an energy about her anyway, that it was a really nice change of dynamic all of a sudden that these two guys had to kind of deal with another presence. It simultaneously made Ben and Trevor’s relationship more intimate and less intimate at the same time.

I’ve heard Rob desirous in other interviews how useful it’s been to find visual shorthands, such as the scene at the end of a montage where Ben wordlessly demonstrates how he’s gotten good at tending to (Craig’s) Trevor’s needs by flipping a paper towel in a particularly efficient way. Has that been interesting to develop, coming from a writing background?

Rob Burnett: Yeah, I think every director would say that when you get into the [editing suite], you want options, it’s so important. I can remember on set, in that montage that you’re referring to where they’re getting to know each other, there’s the thing Trevor pretends to be choking, and Ben runs over and then Trevor laughs. And in one of the takes, Paul hit [Craig] in the back of the head [playfully], and it was great — it was funny — but I remember at the time thinking we may not be there yet with this relationship [at this point in the story]. This is one of your biggest jobs I think as a director [because] the actors do stuff and a lot of it’s great, but you have to know and I wasn’t a 100 percent sure, because I liked what Paul had done, but I remember specifically saying, “Let’s do one of those without the whack on the head.” And then in the final edit of the movie, that would not have worked there — Ben isn’t comfortable enough with Trevor to do that, so a lot of it is options, but some of it is the actors themselves just giving you that stuff. That little thing Paul does with the little flip of the toilet paper, I didn’t tell him to do it. He just did it, and it was so valuable. It’s just like, “Oh, that’s a guy who now knows what he’s doing.” It’s beautiful.

If my timeline’s right, Craig was just coming off his directorial debut “Just Jim.” Did it change your approach to acting?

Craig Roberts: Yeah, it does and it doesn’t. You have to remove yourself from it because going into a job as an actor is a completely different thing. But it definitely helps [knowing] the grammar [of what kind of lenses are being used], like if I hear they’re using “fifth” and “fifty,” I’d know exactly what to do. I don’t really give huge amount of expressions, anyway, so if it’s a wide [shot], I would probably still be as subdued as normal, but it definitely helps with a shorthand with the director. You’re always observing, so I find as an actor, I’m very grateful to be on the set and learning from people like Rob, so I can take things and make it happen.

Rob Burnett: That’s how I feel — I think every director probably feels like that, but I’m learning from myself. No, I’m kidding. [laughs] But that’s how I felt about working with Giles Nuttgens, our cinematographer. You’re taking things all the time, and Giles has so much experience with the camera — and where to put a camera is not a particular strength of mine — so you learn a lot.

Craig Roberts: It’s a tough job. You’ve got to make decisions. If you don’t make decisions, then people think you’re weak, and then it all falls apart. It’s a lot of yeses and nos.

Rob Burnett: You’ve got to be collaborative but not tentative as a director.

Craig Roberts and Paul Rudd in "The Fundamentals of Caring"I’ve heard before getting the job on Letterman, you actually wrote a script for Steven Spielberg. Was a career in movies always in the cards for you?

Rob Burnett: It was crazy. When I graduated college, but before I started at Letterman, I wrote a movie with a buddy of mine [Stephen Engel] because I wanted to be a writer, so I was like, “Let’s write a movie, we can do that.” We wrote this movie. Then I got a job at Letterman as an assistant and I gave this movie to a woman that was there who was a manager. We ended up getting hired to write a movie for the producer Joel Silver, and then a second movie for somebody else. I actually started to have a career as a screenwriter, and got into the Writers Guild before I was a writer on Letterman, and then when I became a writer on Letterman, I got an agent, and that guy gave the script to Spielberg.

I was 25 years old, and I get a call that Spielberg loves our script and wants to fly us to California. My buddy and I had never flown first class before, and we were supposed to go to Spielberg’s house for lunch, but somehow that changed and we went to Amblin. So we’re sitting there like idiots on the couch, and here comes Steven Spielberg into the room — and it was surreal! He sits down and says, “you know, I’ve read a lot of these coming-of-age movies and yours is really terrific.” And it’s like some crazy fever dream, and then I turn to him and I said, “Yeah, I really like your movies too.”

But yeah, he hired us to write a movie about sleepwalking, which never ended up coming to be. Then he got busy directing “Hook.” [The sleepwalking movie] was his own idea, so no one under him [at Amblin] knew how to develop it and it all dissolved. And by then I had become head writer of “The Late Show” and I couldn’t do it any more.

Craig Roberts: What happened to the coming-of-age movie?

Rob Burnett: Nothing. It’s not that good.

Craig Roberts: Spielberg liked it!

Rob Burnett: Spielberg liked it. He didn’t want to make that movie, but he liked that as a writing sample, I guess.

Craig Roberts: That’s flipping crazy.

Rob Burnett: Yeah, it was completely insane.

And you finally got to make a coming-of-age movie with “The Fundamentals of Caring.”

Rob Burnett: Yes, exactly. [laughs] This is the one we shot. Never throw anything away, that’s my motto.

“The Fundamentals of Caring” is now streaming on Netflix.