To store relative pathnames to data sources,

File > Map Document Properties

Check "Store relative pathnames to data sources"

File > Save

If you don't understand why you're doing this, read on.

How to avoid losing the link to data sources in MXD file

If you have worked on labs here and there, you might have experienced the MXD file which has missing source layers, marked as red exclamation points next to corresponding layers in Table of Contents. This happens because MXD file only saves the location of source data, not source data themselves.

ArcMap offers two options for storing the location of data sources. MXD files can store the location of source data using either an absolute (full) or relative path. That is, source data for the MXD file can be retrieved either from the full path of source data (e.g., E:\GEO241\Project) or from the path relative to the MXD file (e.g., \Project).

Storing source data using a relative path is an advantage if you change your workplace often because whether a USB drive is read as E or F doesn’t matter in relative path settings as long as source data and MXD file are stored in the same folder or source data stored in the subfolder (e.g., \Project\Data).