I needed to code the motor to spin using the potentiometer to adjust its speed. I found the reference to the code I needed here. I then changed the pin numbers to what the pin corresponds to. Initially, I was confused as the potentiometer was not working. But later I realised that digital pins cannot process the potentiometer input and I had to use an analog pin. The analog pin for this can be found in the Attiny85 datasheet and for this project, it was A2. After changing that, the code works perfectly.