Samsung has taken a strong stance on security by offering an extended support of security updates for its smartphones.
All Galaxy phones from the Z, S, Note, A, M, XCover and Tab series, launched since 2019 will receive at least 4 years of security updates. At the time of writing that's more than 130 models.
Now, these are security updates and not major OS updates, mind. Samsung recently promised 3 generations of Android OS updates for its flagships, but that is a separate thing altogether.
Security updates can be quarterly or monthly and they can take longer to get to a specific device, depending on its locale or carrier.
Here's the full list of devices that are eligible for at least 4 years of security updates. Interestingly, the Galaxy A02 isn't mentioned, (although the A02s is) and neither are the Galaxy M02 and M02s, so we can't verify if they are among the supported devices.