How Do i even make a afk command

I am like kind of new to coding and wondering how to make a afk command all other afk commands i found were giving me errors

Have you looked it up?

Search it up on google, or try looking at examples of github.

True, I search it up but all of them don’t work.