Check for iCloud lock before you buy.
You can't check iCloud lock with a serial number. Apple took its public Activation Lock checker down in 2017, and nothing it offers the public reads lock status from a serial or IMEI. What works is checking the device itself, and for a Mac, a free Macfax report shows it before you pay.
The lock lives with Apple, not in the serial.
Apple took the checker down
Until 2017, Apple ran a public page that showed whether a device had Activation Lock on. It removed the page that year, and nothing has replaced it for the public.
A serial names the device, not its owner
Activation Lock ties a device to its owner's Apple Account, and Apple holds that link. The serial and the IMEI identify the hardware. Neither one carries the lock.
Paid iCloud checkers are unverified
Sites that sell an iCloud check by serial or IMEI are not using any service Apple offers the public. Their answer can't tell you what the device will do when you set it up, so don't pay against it.
Check the device, not the serial.
iPhone or iPad
Turn it on. A lock screen or Home Screen means it hasn't been erased, so have the seller sign out of their Apple Account and erase it from Settings → General → Transfer or Reset → Erase All Content and Settings. Then start setup. If it asks for the previous owner's Apple Account password, it is still locked to them.
Mac
On a Mac with Apple silicon or a T2 chip, hold Option and choose Apple menu → System Information. Under Hardware, Activation Lock Status should read Disabled. A free Macfax report shows Activation Lock, Find My and MDM enrollment on one page the seller can send you.
Buying remotely
A listing can't show you the setup screen. Ask the seller to remove the device from Find My on iCloud.com before it ships, and pay with buyer protection until you have set it up yourself. For a Mac, ask for a Macfax report link first.
A serial still tells you what it is.
The serial can't show the lock, but it does pin the model. Look it up to confirm the listing describes the device you are paying for, then check the lock on the device itself.