How can a solute dissolve in polar and nonpolar solvents?
A good example of this is ethanol which will dissolve in both water (a polar solvent) and gasoline (a non-polar solvent).
The left side of the molecule has non-polar characteristics because of the C-C and C-H bonds which allows the alcohol to dissolve in a non-polar solvent (gasoline is primarily made of octane which is a non-polar hydrocarbon).
On the right side of the ethanol molecule we see an alcohol functional group (OH). This side of the molecule has polar characteristics which allow the molecule to be dissolved in a polar solvent such as water.