The fuel pump is located within the fuel line. You will need a specia tool to remove the compress fuel line. Once the fuel line is removed you can then remove the fuel pump and add in the new pump. You will then reattach the fuel lines. Be careful as fuel can easily leak.
The best way Ive found, is to drop the fuel tank and unbolt the pump, Replace the old one with the new one and make sure its even, so you can maintain your fuel gauge alignment.
The best way to go about replacing the fuel pump on a GMC Sonoma is to remove the bed as this is much easier and safer than removing the fuel tank with gas in it.