In this question, you are given the volume of cylinder (24

cubic unit) and the ratio of the height:radius (3:1). Putting it into equation, it will look like this:
volume= 24

cubic unit
height = 3 radius
radius = 1/3 height
Using the volume formula of cylinder you will got the height
Volume=

* radius * radius * height
24

cubic unit =

*(1/3 height) * (1/3 height) * height
24

cubic unit /

= 1/9 height cubic
1/9 height cubic = 24 cubic unit
height cubic = 24*9= 216 cubic unit
height=∛216 cubic unit= 6 unit