The reliable trace analysis of high-purity chemicals and environmentally relevant samples is more important than ever and has led to the development of novel analytical methods. Total reflection x-ray fluorescence (TXRF) analysis is an increasingly known method for the determination of heavy metals at low concentration levels in environmental and industrial sample systems. However, there is still a need for optimization to obtain fast and precise results, especially for highly saline samples like brines and salts used in battery production or sea water. In this study, multi-element standard solutions containing analytes like Co, Cr, Cu, Fe, Mn, Ni, or Zn in a concentration range between 0.1 and 1 mg/L were analyzed in the matrices lithium carbonate (Li2CO3) and artificial seawater (ASW) containing 1000 mg/L Li and 24,000 mg/L NaCl, respectively, leading to matrix-analyte ratios of up to 240,000:1. Different sample preparation methods were compared in order to achieve the highest possible repeatability (1) and signal-to-noise ratios (2) with the least amount of time (3). Various parameters such as sample volume, drying conditions, time, temperature and additive concentration were varied. The relative standard deviation (RSD%) was used as a measure of repeatability for three replicates per sample. For lithium carbonate, a method with a preparation time of only 2 min and a measurement time of 500 s could be developed, which allowed to obtain RSD% well below 5%, a high linearity (R-2 > 0.99) and limits of detection (LOD) in the range of 30 mu g/L to 60 mu g/L for most elements. Seawater analysis could be optimized with respect to signal-to-noise ratio, whereby the K alpha-line of the internal standard (Ga) was used for evaluation and the use of a desiccator was found to yield the best results.