SN1 or SN2?

How to determine which mechanism is occurring?

It's easy for methyl, primary (1o) and tertiary (3o) halides and tosylates. Methyl and 1o halides and tosylates will undoubtedly follow the SN2 pathway since they can not form stable carbocations required for SN1, and they have the least steric hindrance (favors SN2). Tertiary (3o) will follow SN1 pathway since they can form stable cations and have the most steric congestion which limits nucleophilic attack in SN2 like reactions. Secondary halides and tosylates are difficult to predict (in practice, they can be problematic as well). Bear in mind that elimination reactions (E1/E2) compete with substitution and often times elimination products form as well.