He said his mother, who died in 1997, "felt a responsibility to shine her spotlight on the people and issues that were often ignored".
The prince said that although he's sure his mother would be proud of his work, that's not why he chooses to follow down a similar path.
In April 1987, Princess Diana opened the UK's first objective built HIV/Aids unit that exclusively cared for patients infected with the virus, at London Middlesex Hospital.
On Thursday evening, the royal attended the Attitude magazine awards, where he called on people to "embrace regular testing" for HIV and AIDS.
"She knew that AIDS was one of the things that many wanted to ignore and seemed like a hopeless challenge", the prince said about his mother while accepting the award.
Harry said she understood the disease created a risky situation "when mixed with homophobia".
Prince Harry is doing his mum's work.
"So when that April, she shook the hand of a 32-year-old man with HIV, in front of the cameras, she knew exactly what she was doing. She was using her position as princess of Wales, the best known woman in the world, to encourage everyone to educate themselves, to be compassionate and to reach out to those who need help instead of being repelled", he said. "She did not live to see this treatment become widely available and save countless lives in the United Kingdom and around the world".
Styles added: "2017 may mark 20 years since the death of the princess, but it also marks 30 years since the start of her HIV activism, and her opening of the UK's first hospital unit dedicated to HIV/Aids". Prince Harry accepted the Legacy Award that acknowledges the groundbreaking contributions his mom made when she was still alive.
Prince Harry continued to explain what life was like for HIV and AIDS sufferers during that time.
Last year, Prince William appeared on the cover of Attitude magazine, who held the awards tonight, speaking out against homophobia, bullying and prejudice.