Talk to your partner about the prospect. Also, the "accidentally-slipping-it-in" move is an asshole thing to do. You can cause serious damage by pulling a stunt like that. Considering the nightmare that can come out of there after a night at a Mexican buffet, I can see how people would think that.
Using plenty of lube will ensure that the sex goes smoothly. It will prevent the anus from becoming damaged during fucking. A condom will also tear more easily if not enough lube is used. There are different kinds of lube.
If you're thinking about having anal sex or engaging in any kind of anal play, your safety and comfort and pleasure should always be at the forefront of your mind. Unfortunately, when it comes to anal penetration, you can't just go in there without any preparation. You're going to need a good quality lubricant especially designed for the anus. Here's why anal lube is so necessary, what the different types are, and the best product for every budget.