i know a transistor is a device that controls the flow of current but how does it act as a switch and an amplifier? i tried reading about it on so many places but i just cant seem to get it

...the diagrams just dont make sense to me

...Can anyone just explain to me in a real simple language about the mechanism would be really grateful