Keep in mind that any third party apps which have a required online component, then they will stop working once those apps are no longer being updated by their developers. These days many third party developers are only supporting the three most recent versions of macOS. Once macOS is no longer officially supported by Apple, then you will be on a clock with those third party apps. Some may work for a year or more after support has been dropped.....it all depends on how much those online servers change will determine how long those old online apps continue to work.
Third party software without a required online component will continue to work until the computer finally breaks. Of course, if you happen to erase & setup up the computer again, then third party apps which require a product key/license activation server may no longer be able to be reinstalled. Microsoft and Adobe are notorious for turning off product activation servers for older software, but there are others as well.
With a laptop, keep in mind that the Battery will most likely need to be replaced (generally this occurs between 3-5 years of use, but some may last a bit longer). An official OEM Apple battery repair/replacement is the best option when available since the quality of third party Lithium Batteries is extremely poor even when purchased from a reputable vendor such as OWC or iFixIt (others are even worse).
Also, buying used Apple devices is risky because many of them are not properly prepared for sale or transfer. This forum is full of such posts. Many are still being managed and under the control of their previous owner. If you buy one of these devices which are still being managed & controlled by the previous owner, then you risk everything (both your data being wiped or possibly even accessed, and the device becoming a brick). It can be difficult to confirm whether a Mac is still being managed & controlled....sometimes it can take weeks depending on how the MDM profile is configured....some are strict, others less so.
What to do before you sell, give away, trade in, or recycle your Mac - Apple Support
Edit: An M1 MBAir 2020 was only discontinued in March 2024 so the hardware will still be fully supported by Apple until 2029 (with limited hardware support until 2031). I would expect that laptop to likely get macOS 28 next year, but doubtful it will receive any after that....it is possible macOS 27 could be the last OS for a 2020 model. No one will know until Apple makes those announcements....my guess is based on previous models.