You probably didn't understand the dialogue in the shrieking shack. Lupin was telling Black to kill Petigrew, not Harry.
James Potter (JP) met his wife Lily (sister of Harry's aunt Petunia) while they were both at Hogwarts. James also met Sirius Black, Lupin, and Petigrew while at Hogwarts. Black and JP were very, very good friends, but they also ran around with Lupin and Petigrew. Lupin had been bitten by a werewolf as a child, but Dumbledore let him attend Hogwarts anyway. Once a month, Lupin would go to the shrieking shack in Hogsmead via the secret tunnel under the whomping willow, and he would turn into a werewolf. JP, Black, and Petigrew figured out what was going on, and became animagi to keep Lupin company as a werewolf. No one knew that Black turned into a shaggy dog, James Potter turned into a stag, and Petigrew turned into a rat. Normally before becoming an animagi, a wizard must register with the Ministry of Magic for two reasons: a) becoming an animagi is extremely dangerous; b) so they can be identified even in their animal form.
Once James and Lily Potter realized that Voldemort was coming after them, they performed a complex charm which would hide their location. The only way a person could find them is if their "secret keeper" told their location to that person. Most of James and Lily's friends knew that Sirius was going to be their secret keeper, but at the last minute they changed to Petigrew. The only people that knew that they changed were Petigrew, Sirius, James, and Lily. Problem was that Petigrew was in leauge with Voldemort, and he told Voldemort where James and Lily were. Voldemort then went and killed both of them, and tried to kill Harry. Voldemort's curse backfired when he attacked Harry, almost destroying him.
Everyone in the wizarding world assumed that Sirius Black had sold out the Potters to Voldemort, when it was actually Peter Petigrew. Sirius knew he was headed for Azkaban unless he found Petigrew. Once Sirius caught up with Petigrew, Petigrew blew up a street full of Muggles and made it look like Sirius's fault. Petigrew also made it look like he was killed and all that was left behind was a finger. What really happened was that in the chaos, Petigrew cut off his own finger and changed into a rat to escape. He ended up living with a wizarding family (the Weaslys) for years.
The Weaslys won a large amount of prize money, and used the money to take a trip to Egypt. Their photo was taken for the Daily Prophet. Black was able to get a copy of the paper from Fudge (the Minister of Magic) when Fudge was visiting Azkaban. He saw the picture, recognized Scabbers as Petigrew, and broke out of Azkaban to hunt him down. People assumed Sirius was after Harry when he was actually after Petigrew.
BTW, the Maurader's Map was written by Moony (Lupin), Wormtail (Petigrew), Padfoot (Sirius Black), and Prongs (James Potter).
R