Let the two numbers be say 8 and 36.
Write out the prime factors of each number.
8=color(red)(2xx2)xx2
36=color(red)(2xx2)xx3xx3
Observe that color(red)(2xx2) are common to both. Observe this is HCF of two numbers.
What are others? color(purple)2 is remaining in first and color(green)(3xx3) remain in second.
Multiply all to get LCM i.e. LCM is
color(red)(2xx2)xxcolor(purple)2xxcolor(green)(3xx3)=72
Simiilarly, let the three numbers be 8, 12 and 20 and then
8=color(red)(2xx2)xx2
12=color(red)(2xx2)xx3
20=color(red)(2xx2)xx5
Observe that color(red)(2xx2) are common to the three. Observe this is HCF of three numbers.
What are others? color(purple)2 is remaining in first, color(green)3 remains in second and color(blue)5 remains in the third number.
LCM is color(red)(2xx2)xxcolor(purple)2xxcolor(green)3xxcolor(blue)5=120