The right approach depends on three factors: how similar the marks are, how closely the goods and services overlap, and how actively the earlier owner enforces their mark.
If the similarity is significant and the classes overlap directly, the options are to adjust the mark to increase the distance between the two, negotiate a co-existence agreement with the earlier owner, or consider whether the earlier mark can be challenged on validity grounds.
If the similarity is marginal or the goods and services are in different enough classes, proceeding with the application may be a reasonable risk. The earlier owner may not file an opposition, or if they do, the case may not succeed. A trademark attorney can give you a realistic assessment of the risk before you commit to a course of action.
Get a professional view on your situation with a free lawyer's check.