In terms of accessories like lights, GPS, etc. the only way to be safe is to remove them entirely. Remember that if something is quick-releasable for you, it's also quick-releasable for thieves. Bike lights will frequently get stolen even if they aren't easily removable, because they're valuable. There is an assortment of "anti-theft" bike accessories available, but most of them just rely on obscure screws, and they tend to be interiorinferior products becauseas they must make other compromises in order to be harder to steal while also being priced competitively.
For bike components you may also want to remove as many quick release levers as possible. I've had a seat + seatpost stolen before, and know many people whose wheels have been stolen. You can lock your bike in such a way to prevent wheel theft, but it's impractical to lock things like seats, so you have to make it as difficult as possible.