If you want to make electronics and sell them to people*, there are a number of regulations you need to follow. Some of them are RoHS and REACH, which deal with the restriction of certain substances in anything that is sold in Europe. If you put a CE mark on your product, which is required for selling electronic products in the EEA (EØS), it is a declaration that your product complies with these standards (among others).
*conditions and exceptions apply
The Restriction of Hazardous Substances Directive (or Directive on the restriction of the use of certain hazardous substances in electrical and electronic equipment to friends) says that you can't have Lead, Mercury, Cadmium, Hexavalent chromium, Polybrominated biphenyls, Polybrominated diphenyl ether, Bis(2-ethylhexyl) phthalate, Butyl benzyl phthalate, Dibutyl phthalate or Diisobutyl phthalate in your product, above certain limits given in parts per million (ppm). Actually, not only are you not allowed to have those things in your product, you also need to be able to document that you don't. In fact, it's not enough to be below the limits for the overall mass of the product; you also need to be able to prove that every subassembly and component of your system is below the ppm limits individually.
Registration, Evaluation, Authorisation and Restriction of Chemicals is like RoHS but more complicated, encompassing 209 substances as of 2020. It has been described as "the most complex legislation in the history of the EU". Fortunately, the practical steps to implement it are the same as for RoHS. Unfortunately, as opposed to RoHS, this list may be updated 2-4 times a year. In principle each update may add new relevant requirements for compliance, making previous compliance outdated.
Thankfully, most of the work of complying with these standards has already been done by the major professional component suppliers.