I am hearing rattling noise under the compartment were the spark plugs go

I can't turn the ignition switch or roll the windows up do to the the security fail switch. Help me please?
I got a big problem and I got to handle this soon as possible.

Recently I replace my car battery however a couple months later it went dead my roadside service said that it was my alternator took it to the shop. shop said that my alternator was fine and couldn't find a problem. A couple weeks later my car went dead again. Roadside came back out again and said that the cables connected to my battery wasn't tight enough. After tightening them again, they worked fine for a couple of days but every couple of days it comes loose and the car dies again. This last time I tighten it again but when starting my car the gauges didn't work, the speed, the gas or the dashboard monitor just did not work however the lighting in the gauges does work and my radio and all other lights do work.

All the time

car has lots of miles, we drove only about 5 miles when it overheated and engine stopped. what damage is likely to engine?

I went out to start the car this morning in the garage. The brake pedal seemed stiff and the gear shift wanted to lock. I used the manual button to free the gear shift. When I tried to start the car, the panel lights flicker and dimmed and I got a clicking noise. When I turned off the key, there were some addition noises coming from under the hood...

I replaced both knock sensors (KS) and harness with OEM Toyota parts. I had a professional shop make the repairs. 30 days after install I am getting 0325 code again on one KS. Now have to replace again. Is it common for the KS to continually go out? I reordered the KS and harness from Toyota to try this process again. Is there another issue I should be looking at before repeating the repair?

I believe I can use a wire across two terminals on the Diagnostic box un der the hood , then turn on the ignition and count the flashes on the engine light , I would like to know which two terminals .

When I had oil changed on 6/4/15 service man asked me if I had changed my timing belt, it was cahnged in 2009 alon w/ water pump as preventitve measur. I was told the bearing in water pump bad and caused the timing belt to become frayed and makeing sqeeking noises. They replaced my spark plugs because they had carbon on them? now cannot get car started? talking about replalcing 12 valve, when they said ONE may have gotten bent? I am not at a Toyota dealer because I only have a CC for Firestone and at the limit. I need help, asap. I am worn out.
They are suppose to look at it again Mon 7/6/15 and I have to do something.
Thanking you in advance with any advice.

Did tune up replaced cam sensors and ox2 sensor car runs good
Cleared code lights come back on in 10 miles can go 300to 400
Miles car runs rough stop turn car off restart runs good was told could b cat

Engine idles perfectly with no misfires when transmission is in park or neutral. This is the 3.0 V6 engine.

Independent garage says they had nothing to do with light coming on but searching internet find that this can occur when proper care isn't used to protect wiring.