We have seen many times when discussing the SN2 mechanism that ethers are common products of nucleophilic substitution reactions.
They are synthesized by reacting alkyl halides or other substrates with good leaving groups with alkoxides:

This method of preparing ethers is called the Williamson Ether Synthesis, named after Alexander Williamson, who developed the reaction in 1850.
Notice that the alkyl halide reacts with the conjugate base (deprotonated form) of the alcohol, known as alkoxides. This is because alcohols are weak nucleophiles while alkoxides are good nucleophiles, favoring the SN2 mechanism to obtain the product in high yields:

The alkoxides are prepared from the corresponding alcohols by deprotonating them with sodium hydride:

Besides the alkyl halides, tosylates and mesylates are other excellent candidates for reacting with alkoxides in Williamson synthesis:

Williamson Synthesis for Symmetrical and Unsymmetrical Ethers
Williamson synthesis can be used to prepare symmetrical and unsymmetrical ethers:

One difference with unsymmetrical ethers is that there are two ways you can synthesize them.
For example, isopropyl ethyl ether can be synthesized from the ethoxide ion (CH3CH2O–) as the nucleophile and 2-chloropropane (Path a), or by reacting chloromethane with (CH3)2CHO– acting as the nucleophile (Path b):

Usually, one of the paths is preferred, and to determine it, you need to keep in mind that the reaction goes by an SN2 mechanism and SN2 reactions are favored by less sterically hindered halides. Therefore, path is preferred since it is better to have CH3Br rather than 2-chloropropane, which, as a secondary alkyl halide, is less reactive in SN2 reactions.
Remember, using a bulky strong base such as sodium isopropoxide (CH3)2CHO– or especially if it was tert-butoxide (tBuOK) favors the E2 elimination:

Check out this article on comparing the SN2 and E2 reactions for a more detailed discussion.
The competition between E1, SN1, E2 and SN2 reactions is covered in the following posts:
SN1, SN2, E1, E2 – How to Choose the Mechanism
Is it SN1, SN2, E1, or E2 Mechanism with the Largest Collection of Practice Problems
Ethers through Intramolecular Substitution

Notice that in a similar intramolecular Williamson reaction, the OH and Br are in anti-orientation, as that is the only possibility for the lone pairs in the HOMO orbital to access the LUMO antibonding orbital of the C–Br bond. Additionally, the OH and Br must be in axial positions to allow this antiperiplanar orientation.
Check the article “SN2 and E2 Reactions of Cyclohexanes” for more details and examples on the specifics of substitution and elimination reactions of chair cyclohexanes.
I’ve also written a separate article on the SN1 and SN2 reactions of alcohols – how alcohols act as weak nucleophiles, how the OH group can be converted into a better leaving group, and how these reactions proceed under different conditions.
Check out this 65-question, Multiple-Choice Quiz with a 3-hour Video Solution covering Nucleophilic Substitution and Elimination Reactions:
Nucleophilic Substitution and Elimination Practice Quiz
Check Also
- Nomenclature of Alcohols: Naming Alcohols based on IUPAC Rules with Practice Problems
- Preparation of Alcohols via Substitution or Addition Reactions
- Reaction of Alcohols with HCl, HBr, and HI Acids
- Mesylates and Tosylates as Good Leaving Groups
- SOCl2 and PBr3 for Conversion of Alcohols to Alkyl Halides
- Alcohols in Substitution Reactions Practice Problems
- POCl3 for Dehydration of Alcohols
- Dehydration of Alcohols by E1 and E2 Elimination
- The Oxidation States of Organic Compounds
- LiAlH4 and NaBH4 Carbonyl Reduction Mechanism
- Alcohols from Carbonyl Reductions – Practice Problems
- Grignard Reaction in Preparing Alcohols with Practice Problems
- Grignard Reaction in Organic Synthesis with Practice Problems
- Protecting Groups For Alcohols in Organic Synthesis
- Oxidation of Alcohols: PCC, PDC, CrO3, DMP, Swern, and All of That
- Diols: Nomenclature, Preparation, and Reactions
- NaIO4 Oxidative Cleavage of Diols
- The Pinacol Rearrangement
- Alcohol Reactions Practice Problems
- Naming Thiols and Sulfides
- Reactions of Thiols
- Alcohols Quiz – Naming, Preparation, and Reactions
- Reactions Map of Alcohols
Minor product is given wrong,
It should be NaBr
And
NaI
You Mean conjugate base (deprotonated?) there is a typo , please correct
Thanks for letting me know!