Rem vs em in font size

I still don’t understand the meaning of “rem” and “em” in font size.
Can anyone explain how to decide for coding a webpage?

faster if you just look this up
for eg
https://blog.logrocket.com/using-em-vs-rem-css/#:~:text=Let’s%20get%20started!-,What%20are%20em%20and%20rem%20and%20why%20use%20them%3F,relative%20to%20a%20set%20value.

Thanks.

I will read up the info because if I don’t understand the function of both elements, I won’t be able to use it.