How can we know a gauge theory is not anomalous? Say we have a putative 4d gauge theory coupled to fermions of various representations. In order for this theory to be consistent, we need to check that no there are both no triangle anomalies and no Witten anomaly. Is this a complete list of the anomalies we need to worry about? If so, how do we show this?
 A: $\newcommand{\D}{\mathrm{D}} \newcommand{\d}{\mathrm{d}} \newcommand{\Tr}{\mathrm{Tr}} \newcommand{\Ds}{D\kern-.6em/\kern.1em} \newcommand{\B}{\mathrm{B}} \newcommand{\H}{\mathrm{H}} \newcommand{\SU}{\mathrm{SU}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\U}{\mathrm{U}}$
As @4xion pointed out in a comment, the only anomalies you have to worry about are gauge anomalies. On the other hand, there exists a classification for 't Hooft anomalies, which I will come to in a bit. So if you want to make sure whether there is a gauge anomaly or not, you have to degauge$^{(*)}$ the symmetry. In other words, just forget that the gauge fields are dynamical and regard them as background fields. Of course, once you are familiar with the 't Hooft anomaly classification you can omit the degauging step, it is just there to remind you where the classification comes from.
Degauging
To see the degauging in practice let us go through the Witten anomaly example. There, the usual setup would be to have the partition funciton as
$$ Z = \int \D\psi\;\D\bar{\psi}\;\D A\ \exp\left(-\int \tfrac{1}{4}\Tr F_{\mu\nu} F^{\mu\nu} + \bar{\psi}\; i\Ds\; \psi \right). \tag{1} $$
To consider it as background gauged, you simply forget the $\int\D A$ and the kinetic terms for $A$, having the partition function as a function of $A$
$$ Z[A] = \int\D\psi\;\D\bar{\psi} \exp\left(-\int\bar{\psi}\;i\Ds(A)\;\psi \right), \tag{2}$$
which in turn tells you that under a gauge transformation in the non-trivial sector $A\mapsto A^\lambda$ you have
$$Z[A^\lambda] = -Z[A].$$
In the case of (2), the anomaly is nothing catastrophic, it just tells you that $A$ cannot be made dynamical, i.e. that (1) is ill-defined.
Classifying 't Hooft anomalies
The usual classification of 't Hooft anomalies comes from Symmetry Protected Topological (SPT) phases. In particular, it is well known that putting an SPT phase on a manifold with a boundary it has edge modes, that carry an 't Hooft anomaly and to cancel it you have to cap it off with an anomalous theory, carrying the exact opposite anomaly in one less dimension. Reversing the argument it is usually claimed that all anomalies of a QFT$_d$ can be compensated for by an SPT$_{d+1}$ phase, so that the total partition function $\tilde{Z}[A] := Z[A]Z_{\text{SPT}}[A]$ is exactly gauge invariant:
$$\tilde{Z}[A^\lambda] = \tilde{Z}[A].$$
In other words, you can restore gauge invariance at the cost of specifying data in one higher-dimension.
Now, SPT phases are subject to a classification, a program that was initiated in 2011 with [1], where it was explained that SPT phases in $d+1$ dimensions, protected by a symmetry group $G$ are classified by the cohomology group
$$\H^{d+1}(\B G,\U(1)),$$
where $\B G$ is the classifying space of $G$. This cohomology group classifies, in turn, 't Hooft anomalies in $d$ dimensions. So the first thing to check is if there are any anomalies in $\H^{d+1}(\B G,\U(1))$. You have as many anomalies as the number of non-trivial elements in $\H^{d+1}(\B G,\U(1))$. E.g. if $\H^{d+1}(\B G,\U(1))=\mathbb{Z}_2$, there is one possible anomaly.
However, soon after the above classification, it was noted that cohomology groups don't suffice when you are dealing with fermions. So something more radical must classify those. Nowadays, the general consensus is that fermionic SPT phases in $d+1$ dimensions are classified by a certain cobordism group [2,3]:
$$\mho^{d+1}(\bullet \times G),\tag{3}$$
that is the Anderson dual of the bordism group, where $\bullet$ is a structure, which for fermionic theories you have to take either as the $\mathrm{Spin}$ or $\mathrm{Pin}^{\pm}$ structure. Regarding this, I found the Yuji Tachikawa's lecture notes on the classification of invertible phases quite illuminating. The downside is that calculating such cobordism groups is usually very complicated and involves spectral sequences. A reference with many worked out cases and some detailed computations is [4].
Coming back to the Witten anomaly example, the relevant cobordism group is $\mho^{d+1}\left(\frac{\mathrm{Spin}\times\SU(2)}{\mathbb{Z}_2}\right)$. Here a $\Z_2$ factor is modded out to avoid overcounting, since it is present both in $1\to\Z_2\to\mathrm{Spin}(d)\to\mathrm{SO}(d)\to 1$ and as a subgroup $\Z_2\subset \SU(2)$. Calculating this cobordism group, we find that for $d=4$ it is
$$\mho^5\left(\frac{\mathrm{Spin}\times\SU(2)}{\mathbb{Z}_2} \right) = (\Z_2)^2.$$
So there are two possible anomalies. One of them is, of course, the Witten anomaly. The other is the Wang-Wen-Witten anomaly [5]. If they hadn't found this anomaly, you could have predicted it by calculating this cobordism group.
Summary and explanation
Gauge anomalies are just 't Hooft anomalies that you didn't care about and gauged the symmetry and now they come back and haunt you.
't Hooft anomalies in $d$ dimensions, associated to a global symmetry group $G$ are classified by cobordism groups: $\mho^{d+1}(\bullet\times G)$. Calculate $\mho^{d+1}(\bullet\times G)$ and you know how many anomalies you have to search for. By the bordism invariants, you infer exactly which anomalies it is that you have to search for. If a pure Chern-Simons term saturates one of the topological invariants, you have a perturbative anomaly. If you need other topological terms, there are some global features in there. For more information about these refer to [4].
Extension
It might be possible that the story is not over yet and there are more anomalies. It is believed that the recent classification [6], through braided automorphisms of the representation category of the symmetry group, is more complete. If you do find anomalies that are not present in (3), go down the category way and see if they're there.
Good luck hunting anomalies!

$^{(*)}$ it would be saner to call it ungauging, but ungauging usually refers to gauging a Pontryagin dual global symmetry which in turn effectively ungauges the original symmetry. Here we are doing something way less elaborate.
References
[1] X. Chen, Z.-C. Gu, Z.-X. Liu, X.-G. Wen, Symmetry protected topological orders and the group cohomology of their symmetry group, arXiv:1106.4772.
[2] D. S. Freed, M. J. Hopkins, Reflection positivity and invertible topological phases, arXiv:1604.06527.
[3] K. Yonekura, On the cobordism classification of symmetry protected topological phases, arXiv:1803.10796.
[4] Z. Wan and J. Wang, Higher Anomalies, Higher Symmetries, and
Cobordisms I: Classification of Higher-Symmetry-Protected Topological States and Their Boundary Fermionic/Bosonic Anomalies via a Generalized Cobordism Theory, arXiv:1812.11967.
[5] J. Wang, X.-G. Wen, E. Witten A New SU(2) Anomaly, arXiv:1810.00844.
[6] L. Kong, T. Lan, X.-G. Wen, Z.-H. Zhang, H. Zheng, Classification of topological phases with finite internal symmetries in all dimensions, arXiv:2003.08898.
