Due to the factor of $(-1)^n$, we can see that this lattice is actually periodic with a period equal to two sites. That is, we've got a lattice with a two-site basis. As such, when we define our momentum-space operators, we have to take this periodicity into account. To do this, we define two sets of operators via
\begin{align}
\hat{a}_k&=\frac{1}{\sqrt{N}}\sum_{j=0}^{N-1}e^{-ika(2j)/2}\hat{c}_{2j}\,,\\
\hat{b}_k&=\frac{1}{\sqrt{N}}\sum_{j=0}^{N-1}e^{-ika(2j+1)/2}\hat{c}_{2j+1}\,,
\end{align}
where $a$ is the lattice spacing (i.e., the distance between every two sites), $N$ is the number of primitive unit cells (and so half the total number of sites), and we apply periodic boundary conditions, i.e., $\hat{c}_{N}=\hat{c}_0$, etc. The allowed values of $k$ are determined by assuming periodic boundary conditions, yielding
$$
k\to k_m=m\frac{2\pi}{Na}\,,~~~~~~~m=0,1,\dots,N-1\,.
$$
Accordingly, we have the orthogonality condition,
$$
\frac{1}{N}\sum_ne^{i(k-k')an} = \delta_{kk'}\,,
$$
which allows us to invert both of the previous definitions as
\begin{align}
\hat{c}_{2j}&=\frac{1}{\sqrt{N}}\sum_ke^{ika(2j)/2}\hat{a}_{k}\,,\\
\hat{c}_{2j+1}&=\frac{1}{\sqrt{N}}\sum_ke^{ika(2j+1)/2}\hat{b}_{k}\,.
\end{align}
Using these definitions, let's rewrite terms in the Hamiltonian as follows. First
$$
\sum_n(-1)^n\hat{c}_{n+1}^{\dagger}\hat{c}_n = \sum_n\hat{c}_{2n+1}^{\dagger}\hat{c}_{2n} - \sum_n\hat{c}_{2n+2}^{\dagger}\hat{c}_{2n+1}\,.
$$
Plugging in for the operators yields
\begin{align}
\sum_n\hat{c}_{2n+1}^{\dagger}\hat{c}_{2n}
&=
\sum_n\frac{1}{\sqrt{N}}\sum_ke^{-ika(2n+1)/2}\hat{b}_{k}^{\dagger}
\frac{1}{\sqrt{N}}\sum_{k'}e^{ik'a(2n)/2}\hat{a}_{k}\\
&=
\sum_{kk'} \hat{b}_{k}^{\dagger}\hat{a}_{k'}
e^{-iak/2}\frac{1}{{N}}\sum_ne^{ia(k'-k)n}\\
&=
\sum_{k} e^{-iak/2}\hat{b}_{k}^{\dagger}\hat{a}_{k}\,,
\end{align}
and
\begin{align}
\sum_n\hat{c}_{2n+2}^{\dagger}\hat{c}_{2n+1}
&=
\sum_n\frac{1}{\sqrt{N}}\sum_ke^{-ika(2n+2)/2}\hat{a}_{k}^{\dagger}
\frac{1}{\sqrt{N}}\sum_{k'}e^{ik'a(2n+1)/2}\hat{b}_{k}\\
&=
\sum_{kk'} \hat{a}_{k}^{\dagger}\hat{b}_{k'}
e^{-ika}e^{ik'a/2}\frac{1}{{N}}\sum_ne^{ia(k'-k)n}\\
&=
\sum_{k} e^{-iak/2}\hat{a}_{k}^{\dagger}\hat{b}_{k}\,,
\end{align}
where we have used the orthogonality relation to compute the sums over $n$ and then collapsed the double sum over $k$ and $k'$ using the resulting $\delta_{kk'}$.
The other two terms in the Hamiltonian are just the Hermitian conjugates of these ones, and so all told we have
\begin{align}
\hat{H}
&=
t\sum_{k} e^{-iak/2}\hat{b}_{k}^{\dagger}\hat{a}_{k}
+
t\sum_{k} e^{iak/2}\hat{a}_{k}^{\dagger}\hat{b}_{k}
-
t\sum_{k} e^{-iak/2}\hat{a}_{k}^{\dagger}\hat{b}_{k}
-
t\sum_{k} e^{iak/2}\hat{b}_{k}^{\dagger}\hat{a}_{k}\\
&=
2it\sum_{k}\sin\left(\frac{ka}{2}\right)\left(
\hat{a}_{k}^{\dagger}\hat{b}_{k}
-\hat{b}_{k}^{\dagger}\hat{a}_{k}
\right)\,.
\end{align}
We can see that we have succeeded in diagonalizing the Hamiltonian in the quasi-momentum $k$. Now we just need to diagonalize the remaining piece.
To do this, wee define new operators as
$$
c_{k,\pm} = \frac{\pm i\hat{a}+\hat{b}}{\sqrt{2}}\,,
$$
in which case
$$
\hat{a}_k = \frac{i(\hat{c}_{k,-} - \hat{c}_{k,+})}{\sqrt{2}}\,,~~~~~~~~\hat{b}_k = \frac{\hat{c}_{k,-} + \hat{c}_{k,+}}{\sqrt{2}}\,.
$$
Then, plugging this into the terms above, we get
$$
\hat{a}_k^{\dagger}\hat{b}_k
=
\frac{-i(\hat{c}_{k,-}^{\dagger} - \hat{c}_{k,+}^{\dagger})}{\sqrt{2}}\frac{\hat{c}_{k,-} + \hat{c}_{k,+}}{\sqrt{2}}
=\frac{-i}{2}(
\hat{c}_{k,-}^{\dagger}\hat{c}_{k,-}
+\hat{c}_{k,-}^{\dagger}\hat{c}_{k,+}
-\hat{c}_{k,+}^{\dagger}\hat{c}_{k,-}
-\hat{c}_{k,+}^{\dagger}\hat{c}_{k,+}
)\,,
$$
which implies that
$$
\hat{b}_k^{\dagger}\hat{a}_k=(\hat{a}_k^{\dagger}\hat{b}_k)^{\dagger}
=\frac{i}{2}(
\hat{c}_{k,-}^{\dagger}\hat{c}_{k,-}
+\hat{c}_{k,+}^{\dagger}\hat{c}_{k,-}
-\hat{c}_{k,-}^{\dagger}\hat{c}_{k,+}
-\hat{c}_{k,+}^{\dagger}\hat{c}_{k,+}
)\,.
$$
Then,
\begin{align}
\hat{a}_k^{\dagger}\hat{b}_k - \hat{b}_k^{\dagger}\hat{a}_k
&=
\frac{-i}{2}(
\hat{c}_{k,-}^{\dagger}\hat{c}_{k,-}
+\hat{c}_{k,-}^{\dagger}\hat{c}_{k,+}
-\hat{c}_{k,+}^{\dagger}\hat{c}_{k,-}
-\hat{c}_{k,+}^{\dagger}\hat{c}_{k,+}
)
-
\frac{i}{2}(
\hat{c}_{k,-}^{\dagger}\hat{c}_{k,-}
+\hat{c}_{k,+}^{\dagger}\hat{c}_{k,-}
-\hat{c}_{k,-}^{\dagger}\hat{c}_{k,+}
-\hat{c}_{k,+}^{\dagger}\hat{c}_{k,+}
)
\\
&=
-\frac{i}{2}(
2\hat{c}_{k,-}^{\dagger}\hat{c}_{k,-}
-2\hat{c}_{k,+}^{\dagger}\hat{c}_{k,+})
\end{align}
Finally, plugging this back into the Hamiltonian, we get
\begin{align}
\hat{H}
&=
2it\sum_{k}\sin\left(\frac{ka}{2}\right)\left(
-\frac{i}{2}(
2\hat{c}_{k,-}^{\dagger}\hat{c}_{k,-}
-2\hat{c}_{k,+}^{\dagger}\hat{c}_{k,+})
\right)
=
\sum_{k}2t\sin\left(\frac{ka}{2}\right)\left(
\hat{c}_{k,-}^{\dagger}\hat{c}_{k,-}
-\hat{c}_{k,+}^{\dagger}\hat{c}_{k,+}
\right)
\end{align}