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?

1 ask allah for help to protect you.
2. Be away from the thing which engage you in the sin for example mobile phone, iPad laptop ext