First off, it should be said that you cannot entirely prevent trademark oppositions. However, there are steps to mitigate some of the risks.
Before applying for a trademark, we recommend requesting a professional trademark search (done in Trama free of charge) to find out about identical and similar already registered trademarks that could oppose your application. Your next steps will depend on the result of the search, including the type of similarity discovered and the likelihood of the company coming forward.
Once your level of risk is established, some of the options to lower it include changing the similar elements of the trademark (if possible) or limiting the goods and services items on the application so that your brand's offering doesn't overlap with the other brand's.
However, these are very general recommendations, and we would recommend discussing your options with your legal representative.