O'Grady's early goal put Barnsley in the driving seat and Norwegian striker Pedersen, who was recently signed on a season-loan from Vitesse Arnhem, added a second just after the half-hour mark.
James Vaughan's 61st-minute strike proved to be mere consolation for the visitors as they failed to force an equaliser, despite putting the hosts under pressure for a spell.
The home side started brightly and O'Grady threatened in the opening few minutes, but he was blocked inside the area after receiving the ball from Stephen Dawson.
O'Grady did not have to wait too long to find the net, however, as he netted an eighth-minute opener with a low left-foot finish after seizing on a loose ball in the area.
The lively O'Grady put an angled effort over before Huddersfield had their first real chance of the game. Oliver Norwood tried a curling shot from around 20 yards out which went wide of Mike Pollitt's left-hand post.
Pedersen made it 2-0 in the 31st minute, beating Alex Smithies with a shot on the turn after getting on the end of a cross from Tom Kennedy.
In the closing stages of the half, Norwood had a shot blocked.
Huddersfield's Adam Clayton had a shot deflected wide soon after the break and Vaughan then shot wide, under pressure from Jean-Yves Mvoto.
The pressure applied by the visitors paid off when Clayton picked out Vaughan with a fine through-ball and the in-form striker shot low past Pollitt.
Clayton found Vaughan with another ball played into the area but the striker volleyed straight at Pollitt.
Barnsley never threatened to increase their lead during the second period until Jacob Mellis joined the action as a substitute. He tried a 20-yard shot which was off target and then fired in a drive from further out which was straight at Smithies.
O'Grady then tried to set up substitute Chris Dagnall, playing a good ball into the area, but Joel Lynch did well to nip in ahead of the substitute and clear the danger.
Huddersfield boss Mark Robins threw strikers Martin Paterson and Jon Stead on in a bid to break Barnsley's resolve but the Tykes stood firm and kept their opponents at bay.
With Smithies stranded after going up for a corner deep into stoppage time, Mvoto ran with the ball from his own half with several Huddersfield players in hot pursuit before shooting wide.
After losing 5-1 and 5-2 in their last two games - against Southampton and Blackburn Rovers respectively - it was a much-needed win for Barnsley and their manager David Flitcroft.