Car wont start, headlights/door locks wont come on

Ok been having some electrical issues. Im a disabled war vet and cannot afford overpriced mechanics so me and dad try to fix everything. Started weeks ago while driving if I flashed my high beams on I would lose power which made me think it was the altenator at first. Car left me stranded so had it towed to dads where we are trying to track down the problem on a 96 lexus es300. Now the car wont turn over although I do hear a clicking from the relay upfront. The headlights wont come on and door locks and security system no longer work. Battery is new and good so we thought it was the ignition. Replaced today after tearing apart most of the dash to get to it . It fired up and cranked once then ceased to turnover yet again. When it turned over headlights and all power worked to door locks again. Fuses all seem good but seems there is an intermittent problem somewhere. Checked the 40amp fuse and it looked slightly blackish but intact and checked with volt meter and it tested fine. Im not sure where to go from this point. Maybe the integration switch or starter relay?? any help is appreciated

I would find the starter relay (picture included) and see if it’s the one clicking. If it no longer clicks then I would replace it anyway. If they fail in an open position…it only affects the starter. If the relay hangs up in a closed position…it can cause problems with other electrical components such as headlights and power door locks. I would make sure that new battery is fully charged as well.

With headlight and security system problems, I think the circuit from the battery to the fuse box needs to be checked. There is a fusible link in the circuit that feeds power to the rest of the car, including the headlights, security system, ignition switch, et al. If that link is bad, you can see the intermittent power problems that you have.