Berahino moved to the Potters at the start of 2016, but the former West Bromwich Albion attacker had failed to score in 15 starts and 18 substitute appearances before netting his side's opener in the EFL Cup tie on Tuesday night.
The 25-year-old has acknowledged that he has experienced a tough period of his career, but feels that his effort against Terriers is reward for his perseverance.
Berahino told Sky Sports News: "It has been tough. Coming to Stoke and not being able to hit the ground running was very tough for me. It was a different role for me when I came here, playing as a lone striker, so I struggled to get opportunities to score.
"This season I've started brightly, I've taken my chances. When I got put on against Preston I managed to stay in the team. I just thank God that my hard work is paying off and may it continue."
Berahino will be hoping to feature when Stoke face West Brom at The Hawthorns this weekend.