For example, for a comet that travels on the hyperbolic orbit around the sun.
The kinetic energy is easy to understand. For a mass $m$ and velocity $v$ it is given by
$$E_k = ½mv^2$$
The potential energy formula is (technically) given as
$$U = -μm/r$$
where $μ$ is the Standard gravitational parameter. (I say technically because it can be hard to grasp the concept of negative energy. See the linked articles).
In the case of a hyperbolic orbit the velocity and distance from the sun must be measured; one cannot be derived from the other as is the case with a known elliptical orbit.