How to find optimal quantum states for optical micromanipulation and metrology in complex scattering problems: tutorial | Synapse