Fifteen digits
How to find the IMEI
Every phone has one. It is the phone's own serial number on the mobile networks, and it does not change when the SIM changes.
The fastest way, any phone
Open the dialler as if you were going to make a call and type *#06#. The IMEI appears on the screen at once. Some phones need the call button pressed after the last #. A dual SIM phone shows two IMEIs. Either one will do for the check.
iPhone
Settings, General, About, and scroll down to IMEI. It is also on the SIM tray of many models, and on the back of the box under the barcode.
Android
Settings, About phone, and look for IMEI or Status. Samsung phones show it under Settings, About phone, Status information. It is also on the box.
Before you meet the seller
Ask the seller to send you the IMEI by message, or to photograph the *#06# screen. Then run the check here before you travel. A seller who will not share the IMEI has told you what you need to know.
Check the number matches
The IMEI on the screen, the one under Settings and the one on the box should all be the same. If they differ, the phone in the box is not the phone the box came with.