In the tempestuous Scene 4 of Act 3, Hamlet tells his mother to stop having sexual relations with Claudius.
Refrain to night, And that shall lend a kind of easiness To the next abstinence; the next more easy; For use almost can change the stamp of nature, And [either master] the devil, or throw him out With wondrous potency
This is excellent advice about how to break any kind of bad habit, such as smoking, drinking, overeating, or using illicit drugs. The secret is to get through the first day and night without indulging. This is always hard to do. But invariably the next day and night is easier to get through, and after that the successive days and nights become progressively easier. It is that first day, and especially that first night, that are hard to get through. But succeeding at doing so gives the addict proof that it is possible. This helps to make the second day and night that much easier psychologically, even though the body may still have as strong a craving on the second day and night as on the first. Hamlet considers his mother's sexual behavior a bad habit.