If I buy a secondhand PS4 can I still get the 1 month free PS Plus Trial?
Or since it's second hand, do I have to pay for it? And by paying, do you pay on the PS4 or do you have to buy a PS card?
PlayStation Plus is account-specific. If you sign-up with a PlayStation Network account that has never subscribed to PlayStation Plus before, it should still give you the 1st month free.
do you pay on the ps4 or do you have to buy a ps card
No, you shouldn't need to buy a PS card. You can do it right on the PS4. IMHO, the easiest way to manage your PlayStation Plus account is on a computer via a web browser.
Keep-in-mind though, that when your first month ends, it will sign you up for the monthly rate, which is quite a bit higher (in the long run) than the yearly rate. So if you know you're going to buy it anyway, you'll want to stop it from automatically renewing, let it expire, and then go in and purchase it for a year (or whatever plan you want). Of course, if you don't mind paying month-to-month, you don't have to do anything.