Ah, lube. The sex helper that should be a staple, right next to condoms. And while lube is nice for vaginal sex, it is ESSENTIAL for anything anal. Unlike the vagina, the anus is not self-lubricating and can't get wet unless you help it out. Aside from skipping the necessary prep work, forgetting to use lube is one of the main reasons why anal can be unpleasant for some people.
Thicker lubes are best for anal sex, as anal walls are thinner than vaginal walls, and thus require a lube that can keep them nice and slippery to reduce the chances of cuts and tears inside the rectum. Abrasions increase your risk for contracting an STI, and nobody wants that. Overall, anal sex is considered particularly risky in terms of STI transmission, compared to vaginal or oral sex, so condom use is key (unless you're in a monogamous relationship, and you and your partner have both been tested). And because of that, it's important to make sure to use a lubricant that's latex-friendly. Coconut oil and basically anything in your kitchen, for example, can't be used with condoms.
Another thing to keep in mind is that the anus absorbs water quickly and can dry out easily when you're using a water-based lube, according to sex therapist Kyla Black. Therefore, silicone-based lubes are usually the safest bet. That said, if you're having anal sex with a silicone toy (like a strap-on or a dildo), or engaging in anal play with a silicone butt plug, go with a water-based lube and just make sure to use a lot. (Silicone breaks down silicone, and you don't want your toys breaking down inside your butt.)