I agree, clean immediately.
If you have used water soluble paint then soap and water is the cleanser. For oil based paint (as others have said) I use a proprietary brush cleaner even though it is unavailable in my part of France (everyone seems to use turps. substitute). I buy a bulk lot when in the UK. I use it as I find it superior. However, I do suspend my brushes for a day or two in the cleaner, using one of the "pots" supplied free with the cleaning solution, these usually have a lid which is made of flexible material with a slit which grips the brush handle and ensures that the bristles are not resting on the bottom of the container thereby distorting them. With very fine/slim handled brushes I double/quadruple an elastic band around the handle to stop it descending too far.
Then a couple of days later, rinse with copious quantities of soap and water, finally clean, soapless water. Afterwards wrap the bristles in a strip of newspaper and secure with a twist um or elastic band, this will ensure the bristles finally dry straight.
An old tradesman I knew recommended applying the thinnest smear of linseed oil to the clean dry brush before storage.
This may sound like an elaborate process but I only buy very good quality brushes and so they deserve looking after. I just find there to be a world of difference between a good brush and a "use it and throw it" brush. Some of my brushes are 50 years old!
Roger in France.