First of all Id advice you to reconsider the thought of going for a second hand phone. Here are some of the key points that will help you with buying a second hand phones-
1) Primarily, check if the device is in the warranty period. Phones out of warranty might cause problems and cost you a lot during the use.
2) Check for cracks on the screen, scratches on the body and even for minor dents.
3) Make sure both the cameras are working precisely and no dust is present in between the lenses. Also, the speakers should provide clear music at the highest volume.
4) Examine the physical buttons on the device. They should fully press and should be in working condition. Also, test the fingerprint sensor
5) Always go with trusted sites like OLX that provide verified second hand device sellers.
All these points will help you in buying a second hand device. Moreover, do not rely on online images, always take the phone in hands before buying the device.