A communication method and apparatus are applied to the field of
vehicle to everything (V2X) or the like. The method includes: determining a first slot in a resource selection window, where the first slot is used to transmit a first reference
signal, the resource selection window includes at least one slot, and the first slot is an unreserved slot, or the first slot is a slot reserved for transmitting a second reference
signal; and sending first indication information, where the first indication information indicates the first slot. According to the foregoing method, a flexible method for determining a reference
signal resource is implemented through sensing and resource selection, and the first slot determined in the resource selection window is an unreserved slot or a slot reserved for transmitting the second reference signal. Therefore, a same slot is not shared with a resource for
data transmission, so that sending of the first reference signal in the first slot does not interfere with
data transmission in the first slot, thereby ensuring reliability of
data transmission.