Federer, who is also a UNICEF goodwill ambassador, will star in the 30-second video message, recorded in separate English, French and German versions, to be distributed to broadcasters worldwide.
"I've seen kids in South Africa who've been affected and it's a very big problem, especially in the poorer countries," said Federer, whose mother comes from South Africa.
"It's important to break down discrimination and stigma. Many people always think 'I can't talk to this person', but I think it's very important to speak openly about it," the tennis star added.
Federer said he was willing to play his part and use his sporting profile to help foster hope and motivation amongst those children affected by the deadly disease.
"Sport creates leadership opportunities and teaches children teamwork, encouraging them to make good choices that can reduce their risk of HIV infection ... Sport is a fun way to learn lessons that will last a lifetime," he said.