The following example will walk you though the process of performing a chi-square goodness-of-fit test manually.
Suppose you took a sample of 200 units from a large population, and each response was classified as one of 4 categories; 54 were classified as category "A", 30 were classified as category "B", 38 as "C", and 78 as "D". You want to test if pA = pB = pC = pD = 1/4, where pA is the population proportion in category "A", pB is the population proportion in category "B", and so forth.
A chi-square test compares the observed counts to what you would expect to see if the null hypothesis were true in order to determine whether the differences between the observed and expected counts are "too large" to occur by chance.