By far the easiest way to avoid a diploma mill is to just go to a nearby brick and mortar college. Check its accreditation first although the importance of that depends on what you want to do with your degree when you finish.
If you need to use it to go on with your education, accredited is the only path to choose. The same is true if you are going for government or military jobs that require a degree. Sometimes their job requirements use the word approved or accredited when describing the education needed for the job. Most state licenses also require accredited education.
Most diploma mills cater to those who are interested in distance education. Their schedules require flexibility. Distance education offers this. Diploma mills will generally offer more bang for your buck. That is, they will give you a bigger degree cheaper and faster. If you want an impressive degree title to hang on your wall, this will give it to you without the hassle of really having to learn much.
It’s best not to go for any degree offered on the inside of a matchbook cover. Try to find out who backs the degree offered if a mail order degree is in your future. Not all unusual degree programs are scams. If you can find one where a well-known school will either lend their reputation to the degree or will accept into their higher degree program, you may be in good shape to pursue it. Don’t take the word of the potential diploma mill about the credential. Check carefully with the other college or university before proceeding.