CA's current laws will stop sales of new internal combustion cars and light trucks (what CA calls a pickup) in 2035. Medium and heavy trucks in 2026. There's no mention of taking existing IC cars and light trucks off the road in the current law. Things can change but once they make laws like that they don't move the timeline up. Sometimes they move it back if manufacturers are not ready.
For a while manufacturers were making two versions of many vehicles- a CA compliant one and a 49 state one. That's stopped in motorcycles and cars, and likely diesel pickups. They're all CA compliant. CA regs are no longer as different, there are a number of other states that have adopted CA regs, and manufacturers hate supporting two versions of a product. The emissions sticker under the hood will say if it meets CA emissions.
There may be good tax reasons for buying out of state rather than CA. Someone who lives both in CA and out of state will already be familiar with the tax issues. If you can keep it registered out of state without getting hassled by anyone it's probably cheaper.
New truck prices are really high now and the manufacturers are trying to hang on to those prices as long as they can. If you try to wait them out you may be waiting a while. I've been looking for a new or new to me truck for a while. The good thing is that the value of my current truck is hardly lower than what I bought it for six years ago.