How about some details? Make, model of loco, age etc?
It could be anything from a worn out motor to a seized bearing, or a mechanical jamming in the locomotives drive train, old gunked up lubricants, etc.
About the only thing I can tell from the info you provided is that power is getting to it, but I don't know whether it's in the loco or not...
Depending on the age and make of the model, there might be some ways to prioritize what to look for.
Hit the shaft of the motor with some contact cleaner, followed by a tiny drop of lubricant. See if you can turn the rotor by hand. Disconnect the drivetrain and see if it moves freely. Apply a tiny drop of grease to the gears and a tiny drop of oil to all other drive train components. And I do mean tiny -- like toothpick point tiny. Too much lube is as bad as not enough.
Inspect all drive train components for cracks or burrs.
If it's an old loco with a pancake motor, probably best to just replace the motor. Newer can motors are just much better.
I took the motor back out and put it on the track rails in the motor turn fine but on the driveshaft it seems like one part is a little tight here are some pics of it a part in the pictur with the driveshaft A part could this be My problem the plastic peace does not turn at all I’m not seeing a year or Manufacturer on this engine
A little punctuation in your posts would make them much clearer and easier to understand.
I wasn't so concerned with an EXACT year of manufacture so much as a general idea of how old it is and how long it's been in storage. It looks like a cheapo loco from 20 or so years ago. Several brands in that timeframe had problems with gears cracking.
So if, as you say, the motor turns when power is applied, then let's look elsewhere. Do the locos wheels turn freely when you have it all stripped down like that? Are any of the gears cracked? You said (I think) that they don't turn. You need to find out why.
This is a Bachmann engine. After the Pancake motor, but before + and Spectrum. You have to have the drive shafts assembled correctly or they will bind. That is what is causing the motor to stall making it hum. Do not let it hum very long, it is gettin hot when in this condition,. I’m sure Hoseeker will have a schematic of this engine that will help with the assembly and identifying if all the parts are there. Once assembled correctly, you can see where the bearings are and where you should put lubricate. The metal chassis on these models were sensitive To oxidation. You will need to remove any that is present in the drive train cavities. This can cause the bearings to twist and cause the bind. Good luck,