Food safety is not only about personal health, but also affects public health, economic and social well-being. Therefore, food safety is an important area of common concern and efforts of the government, the food industry and consumers. Food safety testing plays a vital role in protecting public health, maintaining market order and promoting the sustainable development of the food industry. Its ability to find harmful substances in food in time, to protect public health, maintain market order and promote the sustainable development of the food industry has a vital role. The application of analytical instruments in the field of food safety is crucial, and they can provide fast and accurate test results, thus ensuring the quality and safety of food. Such as the total reflection X-ray fluorescence spectrometer, it is widely used to analyze trace elements and contaminants in food and beverage.