Coat a gratin/ovenproof dish with some butter. Layer the dish with sliced potatoes, finely chopped onions and grated Cheddar cheese. Build up layers until dish is full or you run out of potatoes. Finish off with a layer of cheese and a few dabs of butter.
Prepare a beef/chicken stock cube in 3/4 cup boiling water and pour over dish. Season with salt and pepper and bake in at 350 to 375 degrees F until finished, about 1 to 1 1/4 hours.