The nature of dark matter remains an open question and could be in the form of warm dark matter. Sterile neutrinos and axion-like particles are well motivated warm dark candidates, and can decay into photons, which are consequently detectable by X-ray telescopes with keV dark matter mass. Both particles could explain the observed unidentified 3.5 keV line and, interestingly, XENON1T observed an excess at a few keV that can originate from axion-like particles. We study the diffuse emission coming from the Galactic halo, and test the sensitivity of all-sky X-ray survey eROSITA to identify a sterile neutrino or axion-like particle. By Monte Carlo method, we set bounds on the mixing angle of the sterile neutrinos and coupling strength of the axion-like particles. With eROSITA, we will be able to set stringent constraints, and in particular, we will be able to firmly probe the best-fit of the unidentified 3.5 keV line, where we reach an order of magnitude better sensitivity. Moreover, eROSITA is able to confirm an axion-like particle origin of the XENON1T excess for an excess greater than 3 keV.