How do scientists calculate the probability that an asteroid could hit Earth?

Wait 5 sec.

The 2024 YR4 asteroid may come close to Earth, but how do experts calculate this potential impact?