Arduino 12VDC motor controller with limits

Sorry about that, very new to this.

I found this code on the net, what I know is very very limited. Please excuse me, but where would I add the piece of code you just sent?

Apologies, but this is really a spoon feeding exercise when it comes to coding.

Could you please help me with the complete code so I can upload and test it?