Anal Sex help

How does anal sex work? Doesn't it hurt? Isn't it gross? What are the risks ?