There are more ways than the obvious to do this. I'm used to arriving from the north due to where I live, but those northern routes can be adapted.
The train service to Whitby is thin- but from KC is train to York, change for hourly TPE to Middlesbrough, then train to Whitby. Because the train service to Whitby is thin it maybe works more smoothly on the way home.
Sometimes you can reduce that to two trains (one connection) by using a Grand Central Sunderland bound service to Thornaby or Stockton and changing into the Whitby train there, as some of them start back at Newcastle.
However you could take the 10 minute or so walk from Middlesbrough railway station to the bus station then the hourly X93 Scarborough bound bus over the Moors. Another very scenic run.
Or the every 30 minutes X4 bus via the Cleveland Coast, again very scenic.
The arguably better way to join the X4 is LNER to Darlington, then the hourly Northern train to Saltburn. The X4 stops right outside Saltburn railway station. Saltburn is a seaside resort in it's own right, and could be a base for a couple of nights to explore the Cleveland Coast.
Another possible stop over is Grand Central to Hartlepool, for the National Museum of the Royal Navy and the memorials to the Bombardment of Hartlepool (with significant loss of Civilian life) in WW1, then train to Whitby via Middlesbrough. Hartlepool could also be used as a base for a bit of walking on the much neglected Durham Coast- now restored to nature after it's industrial and coal mining past.