Azarenka lifted her only two grand slam singles titles at Melbourne Park in 2012 and 2013 and had never been beyond the last eight since.
But the 33-year-old produced a fine display to defeat third seed Pegula, who was the highest-ranked player left, 6-4 6-1 and will take on Wimbledon champion Elena Rybakina in the last four.
Azarenka said: "My tennis wasn't bad last year but I was not really mentally there. I played with a lot of fear, a lot of anxiety. I worked a lot on my mindset. Challenging myself on things I wouldn't really do before."
Pegula had reached the quarter-finals without dropping a set but was again unable to get beyond that stage, falling to her fifth consecutive defeat, including three in a row in Melbourne.
The American was always trying to play catch-up after 24th seed Azarenka won the first three games and, although Pegula broke with her opponent serving for the opening set, she could not hold her own delivery.
The second set went from bad to worse for Pegula as Azarenka clinched victory after an hour and 36 minutes.