1.5 inch male thread drain coming out of the wall. How do I connect a plastic p trap on it?
You need to find the rest of that trap or purchase a new one. If you can not find a trap that matches yours you will need to cut the old stuff off and start with a new trap kit. I have found even 30+ year old plumbing matches up to brand new pieces. Take this photo to a plumbing store or big box and they can set you up for 3-15$. The house ghee price if you have to cut and replace the lower for the bend with a nut.