As Steven said, there are no guarantees, but there are things you can look at to make some judgements.
First, how mainstream and multi-sourced is the part? Something like the 74xxx series logic chips have been around since silicon was discovered, are produced by various vendors, and will probably be around in some for at the end of time along with cockroaches and smelly socks.
However, many parts, although popular today, are single sourced. Microcontrollers are like this since every vendor has their own sets of wrinkles to add. All you can do is look at the company's history. Individual microcontrollers due to the nature of their technology go obsolete quickly. See how the company has dealt with that over the years. Some are significantly better than others. You can still today buy the long obsolete Microchip PIC 16C54 or 16F84. There are newer parts that cost less, do more, and fit in the same footprint, but Microchip understands the nature of long term products and these are still available.
Also keep in mind that ARM is just a architecture, not a particular part. There will likely be ARM-based products for a while yet to come, but that is of little relevance to your design. You need the specific individual part you are using from that vendor to still be available in 10 years. That said, if the part does go obsolete in 5 years there will more likely be a reasonably compatible replacement if the original part was from a major family.
So the short answer is you have to do your homework and study up on how well the vendor has dealt with this issue over the last 20 years. If the part you are considering is from a new vendor that doesn't have at least a 15 year history, then pick one that does if you're worried about longevity. In the stock market they say past performance is not guarantee of the future success. That's true, but it means more in the semiconductor business where each company has evolved a sort of corporate philosophy.