Their are a lot of dangers buying used Macs these days, especially the USB-C Apple laptops from 2016 - 2019/2020.
Make sure the laptop does not have a firmware password lock enabled by trying to Option-Boot the laptop. If a firmware password lock is enabled, then you will see a padlock on the screen. There is nothing you can do about it, so you should immediately return the laptop for a full refund. If a firmware lock is accidentally enabled after you own the laptop & you don't know the password (or the password does not work), then there is no way for you to have it removed since you won't have the necessary proof of purchase which Apple will accept.
Make sure the laptop is not being managed by a previous owner. This is harder to identify. Check the System Preferences to see if a "Profiles" item is listed. If any "Profiles" are listed return the laptop for a full refund because the previous owner did not properly prepare the Mac for sale and may still have control of it. If there are no "Profiles" listed, then make sure to perform a clean install of macOS. During initial setup make sure the laptop is connected to the Internet so that if the laptop is still being managed by a previous owner, the laptop will call home to Apple and hopefully alert you to the fact the laptop is being managed. However, this is not foolproof as there are times when you may not see any notifications until days or weeks later. If the laptop is being managed by a previous owner, then there is nothing you can do to prevent it.
With an older Mac, the chances of a worn out or failing battery are much more likely. Apple recently raised the prices for a battery replacement (assuming Apple still officially supports the laptop & has the part in stock). Battery repairs now easily cost $250+ US. Getting a third party battery replacement is unwise since the quality of third party Lithium batteries is extremely poor even when purchased from a respected vendor....besides it is a difficult repair where it is recommended an experienced professional perform the replacement. FYI, Apple currently only supports the 2017+ model laptops and the 2017 model will likely be marked as "Vintage" within the next year since the next major version of macOS will not be supported on a 2017 model. Avoid a third party Lithium Battery if at all possible.
Now we get to the really bad news regarding the hardware of the 2016+ USB-C models. They have a lot of known issues, with many known design flaws. The keyboards for the 2016-2019 models utilize a newer style of butterfly mechanism which has been nothing but trouble...so Apple went back to the more traditional scissor design with the later 2019+ models. Besides having known issues with the new key switches, the butterfly keyboards have virtually no tolerance for any type of debris...just about any small particles will interfere with the butterfly mechanism. Plus if you are touch typist, the feel of the butterfly keyboard is terrible.
The Displays for these laptops (especially the 2016 & 2017) models are known to have a higher rate of failure than any other models due to a poor design for the Display cable. This issue is not as bad for the 2018+ models, but they are still somewhat susceptible to the flaw.
The 2016 & 2017 models tend to have the USB-C ports wear out prematurely due to a poor design of the port. While the I/O Board is relatively inexpensive, it is a labor intensive repair to have them replaced.