Hamilton's equations
Define the Hamiltonian as $$ \begin{align*} H(\v q, \v p, t) = \sup_{\dv q} \left[\v p\cdot\dv q - L(\v q,\dv q,t)\right], \end{align*} $$ i.e. the Legendre transform of the Lagrangian $L(\v q, \dv q, t)$ with respect to the generalised velocity $\dv q$.
$\v p$ is called the generalised momentum. $(\v q,\v p)$ is called a conjugate pair.
Assuming the convexity of $L$ with respect to $\dv q$, the Hamiltonian is $$ \begin{align*} H(\v q,\v p,t) = \v p\cdot \dv q - L(\v q,\dv q, t)\qquad \text{with $\dv q$ such that } p_i = \pdfd{L}{\dot q_i}. \end{align*} $$
Example (Hamiltonian with non-relativistic kinetic energy)
By the principle of least action, the Hamiltonian $H(\v q, \v p, t)$ satisfies Hamilton's equations $$ \begin{align*} \dot q_i = \pdfd{H}{p_i}, \qquad \dot p_i = -\pdfd{H}{q_i}, \qquad \pdfd{H}{t} = -\pdfd{L}{t}. \end{align*} $$ (Caution: in the last equation, $\left.\pdd{t}\right|_{\v q,\v p} \neq \left.\pdd{t}\right|_{\v q,\dv q}$.)
Suppose the Hamiltonian $H$ of a system does not depend explicitly on time, i.e. $\partial L/\partial t = -\partial H/\partial t = 0$.
Then $H$ is constant, i.e. $dH/dt = 0$.