Many sleeper trains stop at several places (just like a normal train does) until, say, 10pm. Then they travel for a long time overnight, and stop in several places in the morning.
You can see the Caledonian Sleeper timetable at [1], it's also reasonable to catch it at Watford. It then stops at both Edinburgh and Glasgow (they have split the train in two further south). You can see the Highland train stops at many towns and villages.
You do need to be a bit more alert if you're getting off the train before the terminus, but the attendant will almost always wake the passengers who are due to alight.
You can see the Caledonian Sleeper timetable at [1], it's also reasonable to catch it at Watford. It then stops at both Edinburgh and Glasgow (they have split the train in two further south). You can see the Highland train stops at many towns and villages.
You do need to be a bit more alert if you're getting off the train before the terminus, but the attendant will almost always wake the passengers who are due to alight.
[1] https://www.seat61.com/CaledonianSleepers.htm