The fundamental approach involves framing this question as the "inverse problem of the calculus of variations", wherein, given a set of second-order differential equations, one seeks the necessary and sufficient conditions for transforming them into the Euler-Lagrange equations. The results of this approach can be found on various platforms, including wiki.
However, I still harbor doubts about the underlying premise of this approach. Our understanding of a system may not necessarily begin with its differential equations; rather, we might only be aware of the components of the system (particles, interactions, etc., similar to the positive problem). From this perspective, there seems to be a gap between the question of "whether a given system has a Lagrangian" and the "inverse problem of the calculus of variations."
How can we address this gap?