Certified GKH Gardening Expert
There are a few things that you can do to help prevent the issue in the future, and more than likely kill the pest inside, if his nest isn't too well established. Neem oil, Garlic oil, and rosemary oil are very good insecticides.
This article will help: https://www.gardeningknowhow.com/edible/fruits/figs/fig-tree-borer-treatment.htm
This link will take you to a collection of articles on making your own pesticides: https://www.gardeningknowhow.com/special/organic/