I found this really old Olympus 35DC in my grandparents' old house and I really want to use it but I don't know if it will still work because it hasn't been used for over years.
Check the battery holder. If the old batteries have been taken out you might be fine. One of the risks with older equipment is battery corrosion. If the old batteries have not been taken out they may have started to leak causing damage to the contacts inside the camera body.
It might. It might not, it all depends on how the camera was used/abused, and how it was stored.
Age can affect things like the light-tightness of rubber seals, sticky grease on aperture blades, and shutter timing. The mercury battery the camera was designed to use is no longer available, and you'll have to find a substitute. And bad storage may allow fungus acid waste to etch through the coatings on the lens, or for haze to have formed in the glass of either the lens or the viewfinder window.
Your best bet is to budget for a knowledgeable vintage camera service person to do an inspection and CLA (clean/lubricate/adjustment) service to make sure the camera is in good condition before trying to run a roll of film through it. Probably your biggest hazard is likely to be a light leak, since rubber tends to either grow brittle or gummy over time, and seals may need to be replaced.
That is a very nice tiny fixed-lens rangefinder P&S camera with a fast 40/1.7 lens, and well worth saving and playing with. It's from the '70s. Granted, a CLA service might cost as much as the camera's worth ($85-100), but better to have a working camera than a paperweight. OTOH, you'll only lose the cost of a roll of film and development if there's a problem with the camera to find out if it works, first.
It really depends on the individual camera and how it has been stored.
Before sourcing a film to run through it, gently try the wind on feature and shutter to see if they work. If things are stiff do not try to force them!
The Olympus 35DC is a rangefinder with an automatic shutter (electronically controlled). I have a couple cameras which are quite similar--the Yashica Electro 35 GSN and the Canon Canonet G-III 17.
First, you should be able to wind the camera (no need to waste film), press the shutter release, and see the shutter snap open and close. If not, something may be mechanically wrong with the camera and it could be difficult to fix.
Second, you will want to replace the battery. The original PX625 battery is no longer available due to concern about the mercury it contains. You can get a replacement 625 battery without too much difficulty, it will just have a different chemistry and a slightly different voltage. This will affect the accuracy of the light meter, but it will still be usable. (The original mercury battery type had a very stable voltage and was used as a voltage reference for the light meter.)
The battery will power a solenoid that keeps the shutter open for the right amount of time. The camera will still be able to take pictures without a battery, but only one shutter speed (the fastest, 1/500s) will be available without a working battery. It looks like the aperture is also under automatic control, but I'm not sure how that works with the battery missing--maybe you will only get the largest aperture, maybe you will only get the smallest.
Note that there is a small window on the front of the lens, on the left side if you are looking at the lens from the front. This window has the automatic exposure sensor in front of it, so be sure to keep your fingers away from the window when you are taking pictures.
Where was it previously stored? Check its lens for signs of fungus and haze. Then, Make sure all the dials on the camera are not jammed. This includes the shutter speed dial and the ISO dial (if you have them), as well as the film advance lever.