To get the cockroaches and the eggs out of the electronics you'll need to take the electronics apart and clean them out.
To keep the roaches out of the electronics setup roach motels or roach bate gel near the electronics so that the roaches will be attracted to the roach bait gel or to the roach motels instead of going into your electronics.