Wait until evening to see if the raccoon leaves. They usually leave their dens at night, although they may stay inside if it is cold or they have small young. Once it leaves, seal off entrances and exits to the treehouse with 1/4-inch galvanized hardware mesh or slick metal sheets.
Catch the raccoon with a 10 by 12 by 32-inch or larger trap baited with marshmallows, peanut butter or grapes. Set the trap at night and close it in the morning. If you use a live trap, check with local authorities before setting it to learn how to release the raccoon. Local regulations may also require you to report raccoons you have killed.
Remove all food, water and open garbage from the treehouse and your property, including pet food, to prevent raccoons from returning to it.
Wrap electrified wire around the tree's base to discourage climbing. Keep the wire activated from dusk to dawn. Post a warning sign to prevent accidents.