If you usually commit this sin while in bed, replace your bed with a sleeping bag on the floor

Sleeping in a sleeping bag on the floor is comfortable enough for you to fall asleep in but uncomfortable enough so that you aren’t able to get in the mood to commit this sin.