If your dome light works sometimes and not other times, it might be because the switch in the door is not working, or clogged with crud. Here's how to remove it, and clean it. This DIY is for a 2000 Camry LE, 1MZ-FE, but the switch looks to be the same for model years 1999/2000/2001 but it would be best to check the part number for your car. The part number for my car is 84231-AA030 and all 4 switches show the same part number.
There are switches on each door. Below is a picture of the location in the front door and the rear door, driver side. Passenger side is the same. Be aware that the switch is a single wire switch, and the ground is supplied by the bolt that holds it to the body. So any crud under the bolt/switch that might interfere with a good ground will cause the switch to work sometimes an not other times. Also be aware that the driver side switch also controls the chime for the key being inserted into the ignition. If the chime doesn't work, then it might be this switch. The other door switches only control the dome light.
First unscrew the bolt that holds the switch to the body using a 10mm socket. Rotate the switch until it comes out of the hole. They don't give you too much wire, so pull out as much as you can so the wire doesn't spring back, and get lost in the body. Having to fish it out would be a real PITA. Then depress the clip that holds the wire to the switch.
Once the switch is removed you can take the rubber boot off and you will see the metal body of the switch that has two parts. Once the boot is removed, clamp the metal frame in a vice so you can remove the plastic part of the switch.
With the switch mounted in the vice, wedge a thin putty knive between the metal and the plastic. Carefully pry the plastic piece out being careful not to lose the spring and the other small parts when the spring tension is released. Here's the various pieces of the switch. Notice that the copper "U" shaped thingie contacts the peg sticking out of the plastic piece.
Rough up the peg with a file or emery cloth to remove any oxidation, and file the rounded copper piece that contacts the metal peg. Then assemble the parts together being careful to align the copper piece with the metal peg. The switch comes with some white grease, and I'm sure it is di-electric, as well as for lubrication, so don't clean out all of the white grease. Leave some in the switch.
Then snap the entire switch assembly into the switch body. Put the rubber boot back on the switch and then connect the wire and bolt it back to the body.
If you're lazy you can just pick up a couple of these the next time you are at your local junk yard. They only cost me $1.00 each. The dealer wants $14.00 for each one.

So get them from a junk yard, or clean them up yourself.
.