If you suspect that raccoons are living in the attic or in a similar place in your house, the first thing you need to is to look for their point of entry. Look for a hole 3 inches or bigger in diameter.
Image courtesy: wildlife.pro
Install new metal mesh with a foam gun and close all possible entry points except the one that you think the raccoons use the most.
Image courtesy: salesleadsrescue.com
In the entry point that you did not block, stuff some newspaper.
Take four to five tennis balls and completely soak them in ammonia. Throw these balls in the attic and at places where you think the raccoons may be hiding. The smell of ammonia is too strong for the raccoons to bear. They will definitely try to relocate immediately. For humans, smell of ammonia is not a big issue.
Check the newspaper that you stuffed in the open entry point. Most probably, it will be moved showing that the raccoons had left due to smell of ammonia. Stuff the newspaper back and monitor it for at least 24 hours to make sure that the raccoons do not return. After a day or so, block the last entry point as well.
Add cayenne pepper and 3-5 chopped habanero chili's to boiling water. Let it boil for five to ten minutes and spray the resulting mixture on all entry points that you closed using a spray bottle.
To prevent the raccoon from returning, thoroughly clean the area around your house. Remove bits of junk, pieces of food, barriers that fell from trees and any pieces of litter around your house. Purchase and install metal garbage can with lid to store trash. These cans should have a lid securing device. Keep the lid closed at all times and place heavy weight on the lid to prevent the raccoons from force opening the lid.
Image courtesy: housewares.hardwarestore.com