I would first try cleaning the throttle body. Also check the connection. Unplug (key off) and make sure connector terminals are free of corrosion. If that does not work, the throttle body sensor can be changed without changing the whole throttle body.
NAPA part number 2-60067 CRB.
Thanks tried that but error code came up. So, see below for replacement details part 1: AutoZone ODB II code, tools + part DELCO TPS4270 8mm socket, ice pick, mallet, channel locks (for lower clip install), long tweezer (you will drop something), punch (to drive some clips back on)
The throttle plate should be held open ( can do that with your fingers) when installing the new sensor. Hopefully the new one did not get damaged by not doing that.)
Once installed, before starting truck, turn key on, do not start, step on accelerator pedal slowly down, and slowly back up. Start the truck. It may take 15 to 30 second to find the idle rpm. Let run, slowly pressing on pedal. Should be good from there.
If the code still persists, and I know this should have been done first, you will need to get the voltages checked during operation. This will require a Tech 2 or similar scanner.