The film will be directed by writer-director Richard Curtis, who is renowned for his work on films Four Weddings and a Funeral, Notting Hill and Love Actually.
The track which is titled 'Under The Tree', will feature in the upcoming animated film, That Christmas, and will include voices of Love Actually's Bill Nighy, Killing Eve star Fiona Shaw, as well as former Doctor Who Jodie Whittaker.
That Christmas will also see Succession star Brian Cox star as Santa.
Speaking on this project, Ed Sheeran revealed that he has been friends with director Curtis "for years", having done charity work together. The singer also featured in Curtis' musical film, Yesterday.
"He came to me two years ago to play me the rough of That Christmas. It was just sketches and voices, but it blew me away", Sheeran said.
The singer continued: "So emotional, yet so heartwarmingly funny, like all Richard Curtis movies. I find since having kids, there's a real lack of great animated children's Christmas movies, so I thought this was such an amazing thing to make and put into the world".
"The scene that we wrote this song for is so heartbreaking but so real for many people at Christmas, spending it without the ones they love, for so many reasons".
He added: "I got to work with my older brother on this, which is such a rarity and a gift to work so closely with my only sibling. It felt so good to create something my children would watch, with their uncle, based in the country they live in".
"I find it mad that there isn't more animated Christmas films for kids, but this is going to become a holiday staple, at least in our household".
On this, Richard Curtis expressed his delight at having Ed Sheeran's song in his upcoming festive movie.
"I'm so thrilled to have Ed's beautiful song in our movie", he said. "It's a film set in Suffolk... Ed lives in and loves Suffolk and completely understood the pitch and tone of what we were trying to do".
"We've been friends for many years and - especially now that he's a husband and a father - it's really lovely to have him play such a key part in this film about love, children, and family".
"And, of course, even if he wasn't a friend and didn't love Suffolk, how marvellous to have a wonderful new song by one of the greatest British songwriters ever".
Ed Sheeran has also produced music for The Hobbit film series from Peter Jackson, as well as HBO fantasy series Game of Thrones, romantic film The Fault in Our Stars, and AppleTV+ sports comedy Ted Lasso.
The singer also had a festive-themed chart topper with Elton John called Merry Christmas, while the pair also featured on last year's Christmas song Sausage Rolls for Everyone, which included a contribution from YouTuber LadBaby.