It is operating system specific (or hardware specific if you are coding some kernel-like software, in freestanding C).
I'm focusing on Linux in my answer below.
If you are coding on Linux (in hosted C, as all user programs are), you'll code your event loop around a multiplexing syscall like poll(2) (or perhaps the older select(2), which I usually don't recommend). You might use some event loop library like libev or libevent.
Reading and polling the terminal is tricky on Linux (because tty-s are quite complex). You probably want to use some library, like ncurses, do make a terminal application.
If you want to code a GUI application, you'll practically use some toolkit framework like Qt or Gtk. They provide an event loop, and you'll need to register callbacks.