What is an exception to the general rule that if something is against the law on a federal level, a state cannot decide it is legal?

One exception to the general rule that if something is against the law on a federal level, a state cannot decide it is legal is the matter of marijuana legalization. Although marijuana remains illegal under federal law, some states have chosen to legalize its use for medical and/or recreational purposes within their borders. These states have implemented regulations and frameworks that allow for the cultivation, distribution, sale, and consumption of marijuana without federal interference, in direct conflict with federal law. This exception exists due to the concept of federalism, which allows states to exercise certain powers independently from the federal government.