If you have an existing key, it’s pretty straightforward to do. It takes a while to complete, but it’s not too bad. I had a key fob stolen so I only had one remaining. I also wanted to renumber them for whatever reason that was important at the time (I needed to be Driver #1).
If you bought the replacement online, the harder part is getting the physical key cut. Only a few places have the machine, and the one I went to refused to do it unless I bought the actual key from them. Ace Hardwares tend to have the machine, and they can order just the physical key part for you.
i think the dealer wanted around $300 for the key + programming. I ordered the key fob for $99, programmed myself. Probably spent another $30 or so on the physical key + cutting.
Be careful testing the physical key after cutting. I somehow disabled my truck for around 20 minutes after testing if it worked while the vehicle was “locked”. It was weird and frustrating, OnStar was also no help.