There are a lot of laws around CBD that keep evolving and changing. Each state in the U.S. has its own laws legalizing CBD, some with different restrictions.
The Agriculture Improvement Act of 2018 (also referred to as the Farm Bill) legalized hemp-derived CBD that contains no more than 0.3% total THC (by dry weight). Still, the Food and Drug Administration (FDA) is in charge of regulating products containing CBD, and state laws are not always aligned with the federal regulations. Certain states do not allow products with any traces of THC to be sold, so keeping up-to-date with current state regulations is the best way to determine if it is legal to purchase CBD in your state.