It depends. You don't always use a hammer.
My old Ford station wagon with a loose screw that mounted and grounded the starter solenoid.
Usually it started but not always.
If it didn't start i honked the horn and the vibration may allow it to make contact and start the engine.
Sometimes not.
Stage two. Kick the underside of the dash board. Then it would usually start.
Sometimes not.
Last stage. Get out, walk around and kick the right front fender.
That always worked.
A customer complained that his Automatic Transfer Switch was making a loud noise.
The ATS was based on a pair of magnetic contactors. When a magnetic contactor does not seat properly it vibrates and makes a lot of noise.
I made a fist and then hit the side of the ATS enclosure with the side of my fist. Hard.
The impact caused the contactor to seat and all the noise went away.
I almost forgot the intermittent relay in a mill. I located the panel by hitting the panel supports with a 2x4.
Once I found the panel containing the faulty relay I used a heavy screwdriver handle to hit the relays in turn until I located the bad relay.
Oh and I forgot about the power threader that the boys started with a hammer.
A new threader was delivered to a job site.
One of the electricians was a hard worker but not very bright.
The old Rigid Threaders had a multi prong plug between the switch and the motor.
If the switch or motor needed to be replaced it was plug and play.
The boys decided to have some fun and pulled the plug, under the machine, partly apart.
Our friend tried to start it and it wouldn't start.
One of the pranksters stepped up to help him while holding a three pound hammer.
Our friend became upset that the new machine may be damaged by the hammer.
He was reassured.
"Don't worry, the residual magnetism gets cross-fluxed and the electrons get saturated. It just takes a gentle tap to unflux it and it will start."
Our friend had his eyes on the hammer and didn't notice that the prankster had one hand under the machine.
As he gave the machine a gentle tap he squeezed the plug together and the threader started.
The boys started the machine for our friend a couple of times and were set for another start when they saw the executives from the head office approaching on a site tour.
Everyone faded out of site except our friend. He had a pipe to thread and carried on.
As the group came up to him, he smiled and turned the machine on.
Nothing happened.
He picked up the three pound hammer, smiled at the executives and gave the machine a gentle tap.
Nothing happened.
He hit it harder and nothing happened.
He panicked and started beating on the machine with the three pound hammer.
The tour looked at each other and left as fast as they could.
Moral. The hammer won't always work.
Welcome to the fraternity.
You have discovered an effective and valuable trouble shooting technique.
Bill
--------------------
"Why not the best?"
Jimmy Carter