A new approach to the construction of Lagrangian and Hamiltonian for a second-order differential equation is presented. By writing the second-order equation in the first-order form and constructing first-order Lagranian corresponding to the set of the first-order equations, the second-order Lagrangian and Hamiltionian are deduced from the first-order Lagrangian directly. By using the above method the first-order ane the second-order Lagrangians and the Hamiltonians for some of dissipative and dissipative-like systems are obtained. The advantage of the approach is discussed. Four examples are given to illustrate the applications of the results.