Earlier on I bought Lennard Zinn’s book “Zinn and the Art of Road Bike Maintenance Book”.
I earnestly and politely recommend that, having bought it, you read it.
I sprayed the WD40 on both sides [of the wheel hub] and loosened the nuts and cleaned them. I’m not an expert, but I don’t think there is anything wrong with the wheel hub because I am now able to move the pedals forwards and backwards.
. . . the chain is not staying on any cog, but is instead stuck between the last cog and the frame. . . . the cable to change the gears on the cog has snapped off. So, the bike definitely needs a new cable for the gears. The teeth on the cassette all look very worn. There is no cable to adjust the gears.
So the cranks (them's the levers with the pedals screwed into the ends) now turn backwards. And with the chain unstuck and on a sprocket (cog)) they turn forwards and the wheel turns. Remove the wheel.
You may think the cassette is worn, but it starts off looking like that, by design. Spray it with WD40. Unless the chain is very rusty, a good repeated spray with WD40, followed by a good wipe (kitchen towel or spare cotton rag), letting it dry, and then applying some oil will revitalise it. You do not need to replace it.
The rear gear cable is either "snapped" or it's missing: from your text it's not clear. Either way you need a new cable fitted and the gears indexed. I'm going to take a punt here and reckon you think you are incapable of this. You might be right. This is an inexpensive and quick (?10 minute) job for your LBS. Phone them and inquire:
https://www.yell.com/s/cycle+shops-middlesbrough.html "Replace gear cable and index rear gears (Make/model of bike)."
Replace the wheel, putting the chain on the smallest sprocket (cog) and tighten the nuts/QR lever to secure the wheel in place. Using a small screwdriver on the rear derailleur, turn the little screw marked 'H' one turn clockwise (for the time being). Turn the cranks (with the rear wheel held off the ground). Does the wheel turn (yes). Refit the brake calipers (you will likely have had to undo them to get the wheel out earlier).