The rules set by chess.com and lichess are basically the same (see this and this):
Use of computer programs or chess engines is not allowed for any kind of games. Use of (paper/e-book) opening books and games databases is allowed for correspondence/DailyChess games only.
So you cannot prevent your opponent from using an opening book. If you are uncomfortable with your opponent using help for the opening, there are a few things you can do:
- ask them not to use opening books
- try to play unrated games where players might be more eager to experiment (i.e. play without opening books)
- don't play correspondence games, but longer standard time controls
- go for sidelines that are not in the book (though that will not be good for improving your chess)
However IMO, correspondence chess is a special form of chess and the whole point there is that players get plenty of time in order to analyze the game on a board, in order to consult books, or even to use engines in some of the correspondence chess tournaments. Trying to restrict this seems kind of artificial to me. I mean, if you considered correspondence chess as just a regular game with extended time control (i.e. no external help whatsoever allowed), there is not much you gain from say having an hour per move or having a week for a move.