You can divert the down pipe from your bath or shower into the garden in order to reuse water. Shampoos and soaps are, relatively speaking, fairly mild pollutants and are generally well diluted in bath and shower water, so reuse of these waters for garden irrigation should be safe. To be completely confident about their use, you could buy shampoos and soaps made from natural ingredients. Conversion kits for down pipes can be purchased fairly cheaply, and if you are handy you can do the job yourself.
You can also re-use water from cooking on your flower beds and pots. Any water used for cooking vegetables, for example, is likely to contain valuable nutrients that your plants could utilise. Be careful not to use water loaded with salt or oil.
If you want to use water from your washing machine for your garden then think carefully about the type of detergent you use. Low sodium levels will minimise damage to plants and soil (liquid detergents generally have less sodium than powder ones), and avoidance of phosphates will reduce the chances of eutrphication (nutrient overloading, leading to species loss and degradation) of nearby water courses.