California passed a law this election year allowing the recreational use of marijuana. However, at the federal level, marijuana is still illegal. How can states pass laws that conflict with federal laws? Most important, can people who use marijuana in states in which recreational use is legal still get in trouble with federal authorities?
Technically federal law trumps. It's up to the executive branch how they may or may not want to enforce it. The Obama administration chose to not enforce but didn't change the legal status.
Trump administration, at the moment, seems to lean towards not changing thing either.