What is the height of a lamp whose two radii are 20cm and 30cm and slant height 40cm

Make a diagram of the cross-section of your frustrum

sketch a right-angled triangle and calculate
h^2 + 5^2 = 40^2
.....

solve for h in this Pythagorean equation.