The first and most important thing to understand that there's no one single "Android." Stock Android (also known as AOSP) is the base that developers use to create their own distributions and UI ...
As Hebeisen says, the best way to keep yourself safe is simply to not use a phone that's no longer supported. If you're short on money, can't afford to upgrade just yet or you're using an older phone ...