I have sugar ants in my laptop for a while now. And I want to get rid of them but not damage my laptop.
You migth want to go to a technician, it sounds like you were eating something while on the computer, the ants were attracted to it and laid eggs inside it. They can take it apart and remove the ants, probably.
Spray some ant spray in a rubbish bag. Then positioned your computer in the bag and seal it. Wait some hours. then freshen up the mess with canned air. it is recommended to place your computer in a container. Getting the spray on the plastic could be risky.
Strange question but I would try puting the laptop in an isolated area (a box or something closed off) and putting a lollypop or other food in there with it and maybe they will come out for the food. Of course if they are dead then I have no idea what you should do other than take the laptop apart and pick them out.
I believe I'd try putting the computer in a plastic bag and putting it in your refrigerator for a few hours. The refrigerator should be cold enough to kill the ants, but not too cold as in the freezer to possibly crack the screen. It's probably around 40 + degrees in the frige. Then after the ants are dead, kind of shake them towards the vents on the side to get rid of them. And put that chocolate away!! Good luck!
One, stop eating over your laptop. Two, set out ant traps around your laptop. Three, stop eating over you laptop