Answer by taking a quote from the following article:

William McKinley (January 29, 1843 - September 14, 1901) was the 25th President of the United States, serving from March 4, 1897 until his assassination in September 1901, six months into his second term. McKinley led the nation to victory in the Spanish-American War, raised protective tariffs to promote American industry, and maintained the nation on the gold standard in a rejection of free silver (effectively, expansionary monetary policy). McKinley was the last president to have served in the American Civil War, and the only one to have started the war as an enlisted soldier, beginning as a private in the Union Army and ending as a brevet major.

William McKinley Jr. was born in 1843 in Niles, Ohio, the seventh child of William McKinley Sr. and Nancy (nee Allison) McKinley (1809-1897). The McKinleys were of English and Scots-Irish descent and had settled in western Pennsylvania in the 18th century, tracing back to a David McKinley who was born in Dervock, County Antrim, in present-day Northern Ireland. There, the elder McKinley was born in Pine Township, Mercer County.  The family moved to Ohio when the senior McKinley was a boy, settling in New Lisbon (now Lisbon). He met Nancy Allison there, and married her later. The Allison family was of mostly English descent and among Pennsylvania's earliest settlers. The family trade on both sides was iron-making, and McKinley senior operated foundries throughout Ohio, in New Lisbon, Niles, Poland, and finally Canton. The McKinley household was, like many from Ohio's Western Reserve, steeped in Whiggish and abolitionist sentiment, the latter based on the family's staunch Methodist beliefs. William followed in the Methodist tradition, becoming active in the local Methodist church at the age of sixteen. He was a lifelong pious Methodist.  In 1852, the family moved from Niles to Poland, Ohio so that their children could attend the better schools there. Graduating from Poland Seminary in 1859, he enrolled the following year at Allegheny College in Meadville, Pennsylvania. He remained at Allegheny for only one year, returning home in 1860 after becoming ill and depressed. He also spent time at Mount Union College in Alliance, Ohio as a board member. Although his health recovered, family finances declined and McKinley was unable to return to Allegheny, first working as a postal clerk and later taking a job teaching at a school near Poland, Ohio.

What was their religion?
Methodist