The forward joined the Potters in January 2017 for a fee of £15 million from West Bromwich Albion and has failed to find the back of the net for two-and-a-half years stretching back to his time at West Brom.
However, against Huddersfield, the attacker ended the barren spell to help Gary Rowett’s men progress to the next round of the competition.
"It has been tough. Coming to Stoke and not being able to hit the ground running was very tough for me," Berahino told Sky Sports.
"It was a different role for me when I came here, playing as a lone striker, so I struggled to get opportunities to score.
“But 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."
Reflecting on the goal, he said: "It's massive.The manager made sure that we started brightly against a strong team today. We managed to do that. We got the win and now we can kick on again.
"We've got a big game Saturday. We want to do well before the international break."
Berahino will be looking to build on the performance when Stoke take on his former club West Brom in their next Championship game on Saturday.