Welcome to Biology.SE!
I actually recently went through the literature on this and similar subject, so I'll be happy to answer.
The answer will not be easy to formulate as a number of authors are working and arguing on the question. I will try to give a quick overview of methods.
Definitions: Background selection and selective sweep
First off, let's use the correct terms. As you described, both positive and purifying selection is reducing genetic diversity at nearby loci. When the reduction in genetic diversity is caused by positive selection, we call the process
selective sweep . When the reduction in genetic diversity is caused by purifying selection, we call the process
What affect background selection?
- Recombination rate
- Strength of selection.
- For a given neutral locus at distance $r$ centimorgans from a locus under purifying selection, the selective coefficient $s$ that is causing the highest decrease in genetic diversity is $s=r$ (Nordborg 1997).
- Mutation rate
- population structure
What affect a selective sweep?
- Strength of selection
- population structure
- Number of loci involved under adaptation
- Whether adaptation comes from de novo mutation or standing genetic variation
By the way, you might want to have a look at the terms 'soft sweep' vs 'hard sweep' in relationship to the two last elements of the above list and in relation to local adaptation.
How to disentangle Background selection from selective sweep?
There are a number of technics but again all of that is a work-in-progress. I would like to classify these methods into four themes.
- Environmental covariate
This first element talks about disentangling local selection from background selection. It is maybe not exactly what you asked for but this discussion often comes to center stage in the literature talking about both.
If we assume to know the environmental variable causing the adaptation, then you can compare divergence between population present in different environments and those present in the same environment. If loss of genetic diversity is caused by local selection, then divergence should be higher between population occurring in difference environments. If loss of genetic diversity is caused by background selection, then all populations will show similar divergence. Bayesian Technics such as BayEnv2 (Gunther and Coop 2013) take advantage of this technic.
- Among lineages comparisons
By comparing related species, it is possible to find out regions of low genetic diversity. If all related lineage show similar loss of genetic diversity irrespective to the existence of an adaptive event, then the loss of genetic diversity is likely caused by background selection.
From such methods (but I might not totally understand them, I should read the paper again), some authors (such as McVicker 2009) have build B-map and recently implemented in BayeScan (Huber et al. 2016; BayeScan is an Fst outlier method to detect local adaptation), that is map of the genome of the intensity of background selection measured by the B-value introduced by Charlesworth (history of the term reviewed in Charlesworth 2012)
Both background selection and a selective sweep affect the Allele-Frequency-Spectrum as to cause an excess of rare alleles (Tajima's D < 0). However, the strength of the effect and the detailed effect on the Allele-Frequency-Spectrum is not quite the same and some authors have suggested to use such differences to disentangle the two.
- Machine learning (thank you @ atongsa)
Recently, there has been much interest in using machine learning techniques to develop methods to detect selection. For example, many people are performing numerical simulations of evolving populations and are training a machine learning algorithm to detect loci under selection. Hejase 2020 apply a SVM method and find a rapid avian radiation have been driven by recent selective sweeps. Hejase 2022 developed a Recurrent Neural Network (RNN) by using the Ancestral recombination graph to infer how selective sweeps shape genomic diversity.
There is a lot to read on the subject. I would recommend the recent special issue in Molecular Ecology DETECTING SELECTION IN NATURAL POPULATIONS including the review Haasl and Payseur 2016.