Like any laundry I do, I wash my fabrics with like colors, and I wash and dry them as I would a finished garment or quilt. I generally like to wash with cold water as it uses the least energy and dry with medium heat or hang to dry, depending on the size. I'll throw it into the dryer if it's large and wide because I do not have space to hang it. If it's smaller, about one to two yards of fabric, I'll hang it up to dry.
Other sewists will use dye catchers to prevent dyes from bleeding into other textiles. You can find these in most laundry sections of your local grocery store.
Fabrics can fray during the whole pre-treatment process. To prevent this, serge the raw edges of your fabric before washing. A narrow zig-zag stitch close to the edge of the fabric with your sewing machine will do if you do not own a serger or overlocker.
For smaller pieces of fabric, place them in lingerie bags to prevent them from fraying and tangling onto other pieces.