How can I replace this P-trap
To elaborate on what Hari said, it's important to note that the most common kind of trap is for a PVC to PVC (compression fitting with top-screw). You have a chrome pipe there, so you need a P-trap that is threaded with the screw below.

Something he didn't mention is that, with chrome, you have to have a rubber washer. If I were you, however, I'd go ahead and replace the chrome wall tube as well (you have a reducing cap behind it). Then you can buy a PVC kit that contains both the trap and the wall tube. This will require a washer for that nut, but once it's done you don't need to worry about it again. The reason to do this is the PVC removes more easily if you have a clog. If that washer on the chrome dries out, you'll have to replace it potentially any time you need to remove the trap.