Depends on your level of expertise...easiest for the untutored would be a diamond tester. However, as in most gemology, magnification is your best friend. Diamonds almost always have a sugary, bruted girdle, possibly naturals on the girdle which are diagnostic, and particular internal flaws which imitations and synthetics do not have...internal fractures, carbon spots, etc. If you study some photos from a diamond grading manual, it is easy to become familiar with these. The various substitutes also have characteristic inclusions that are different from those in a diamond.
While differentiating diamonds from substitutes should be fairly easy, distinguishing treated from untreated diamonds requires more expertise and distinguishing the latest synthetic diamonds from natural is, according to GIA, sometimes only possible with sophisticated lab tests. You might start by reading here:
The upshot is that some synthetics will show characteristics that standard gemological tests will show, while others will not. So you can kick out some synthetics, but others may fool you and will need to be sent to GIA for advanced testing.