1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution
I don't see how to do this calculation of ##Z_c##, I need somehow to separate between ##\sigma_j=1## and ##\sigma_j=-1##, and what with ##\sigma_0##?

And to tell you the truth this notation as a mathematician seems absurd to me, the index ##j## is inside the sums of spins in the argument of the exponential, and you are summing over ##\sigma_j## outside it?!

In ##Z_c## the summation ##\sum\limits_{\sigma_j=\pm 1}## means ##\sum\limits_{\sigma_0=\pm 1} \sum\limits_{\sigma_1=\pm 1} \sum\limits_{\sigma_2=\pm 1}...##

It might be a good idea to write out explicitly the case where there are only 2 nearest neighbors (##q## = 2). Begin by writing out explicitly ##H_c## with no summation symbols.

Ok, Lets first work out the notation.
The partition function can be thought of as merely an normalization of some distribution function, as such, we always must sum over all possible configurations.
The lattice in the above example is comprised of ##N## sites, each has the value ##\pm 1##. I t is convenient to define a set ##\sigma## that has ##N## elements corresponding with eace site. Note that there are ##2^N## different sets that can described a physical configuration,

Our Hamiltonian is a "functional" of the "field" ##\sigma##, by that I mean that the functional associates an energy value for each configuration. More formally, the Hamiltonian is a map from the space of all possible configuration to the space of all possible energy levels ##H:\{\sigma\}\to \{E\}##, where I just introduced the notation ##\{\sigma\}## for the space of all possible configuration (which is a set of ##2^N## sets of size ##N##) , and similarly for the space of all possible energy levels.

Now, as mentioned above, in order to get the right partition function we must sum over all possible configurations and thus our partition function is always defined as,
$$Z=\sum_{\{\sigma\}}e^{-\beta H[\sigma]}$$.
The simplest example would be to show the above for the case of two sites,
$$Z_2=\sum_{\{\sigma\}}e^{-\beta H[\sigma]}=e^{-\beta H[\{+,+\}]}+e^{-\beta H[\{-,+\}]}+e^{-\beta H[\{+,-\}]}+e^{-\beta H[\{-,-\}]}$$.

We shall next try to actually calculate the above partition function.
If I understand correctly, we are looking at the site ##\sigma_0## and it's ##q## neighbours.
For a clearer treatment I will define
$$ H_c[\sigma_0,\sigma]=-h \sigma_0-\left(J \sigma_0+h'\right)\sum_{j=1}^q\sigma_i.$$
The partition function will be
$$Z_c=\sum_{\sigma_0=\pm1}\sum_{\{\sigma\}}e^{-\beta H_c[\sigma_0,\sigma]}\equiv\sum_{\sigma_0=\pm1}Z_0[\sigma_0].$$
From the above lines we find,
$$Z_0[\sigma_0]=\sum_{\{\sigma\}}e^{-\beta H_c[\sigma_0,\sigma]}=e^{\beta h \sigma_0}\sum_{\{\sigma\}}\exp\left\{\beta\left(J \sigma_0+h'\right)\sum_{j=1}^q\sigma_i\right\}.$$
Since the exponent of a sum is just the multiplication of exponents, we can rewrite the partition function as,
$$Z_0[\sigma_0]=e^{\beta h \sigma_0}\sum_{\{\sigma\}}\prod_{j=1}^q\exp\left\{\beta\left(J \sigma_0+h'\right)\sigma_i\right\}.$$
Now come the tricky part, since each term in this multiplication is independent of the other terms we can replace the product and the sum in the following way,
$$Z_0[\sigma_0]=e^{\beta h \sigma_0}\prod_{j=1}^q\sum_{\sigma_j=\pm 1}\exp\left\{\beta\left(J \sigma_0+h'\right)\sigma_i\right\}=e^{\beta h \sigma_0}\prod_{j=1}^q2\cosh\left\{\beta\left(J \sigma_0+h'\right)\right\}.$$
We see now that we are multiplying ##q## identical terms, and so we get the nice (almost) final answer,
$$Z_0[\sigma_0]=e^{\beta h \sigma_0}\cosh^q\left[\beta\left(J \sigma_0+h'\right)\right].$$
Now we just need to sum over ##\sigma_0=\pm1## to find that,
$$Z_c=e^{\beta h}\cosh^q\left[\beta\left(J+h'\right)\right]+e^{-\beta h}\cosh^q\left[\beta\left(J-h'\right)\right]$$

But shouldn't we have it:
$$
Z_0[\sigma_0]=e^{\beta h \sigma_0}\prod_{i=1}^q\sum_{\sigma_i=\pm 1}\exp\left\{\beta\left(J \sigma_0+h'\right)\sigma_i\right\}=e^{\beta h \sigma_0}\prod_{j=1}^q2\cosh\left\{\beta\left(J \sigma_0+h'\right)\right\}.
$$

As in your LHS you should be summing over ##\sigma_i## and not ##\sigma_j## as you wrote, in which case I can see how you get the ##2\cosh(\ldots )##.