If one fears that they may sin by looking at pornography what precautions can they take to prevent it especially in situations when they are alone or when they are going to sleep?

It is not permissible to watch them.