Thank you so much for your replies and help. I have removed the L293d shield and gone back to my initial circuit and code. I used pin 9 for the servo and pin 2 for the IR remote along with the 2 ground pins, the 5V and Vin pins.
However, it worked intermittently for a few minutes with this set up, then the motor, which beeped SOS constantly, stopped working, which was why I tried the L293d shield. Please can you tell me what battery and resistor I need to buy and how I should wire these into my circuit? The motor will turn a cast of a hand for a book thumbs up machine. It will go in a child's bedroom, so I need it to be safely powered and wired. It's a build we made for Mark Rober's creative engineering course a few weeks ago. If you could please instruct me exactly for a complete beginner, I would be very grateful.
The hand cast weighs 300g, which is attached via a wooden strut and dowel. I removed the sculpture to test the motor without it on and the motor did not work then either, so the problem is a power one. I chose this motor for its torque:
Stall Torque: 12 kg/cm(4.8V), 15kg/cm(6V)
Dimensions : 54.1 x 20 x 44.3 mm
Weight: 55g
Voltage: 4.8~6V
SUNFOUNDER Metal Gear Digital RC Servo Motor High Torque for Helicopter Car Boat Robot Arduino AVR Toys Drone Fix-Wing Airplane - SUNFOUNDER (amazon.co.uk)