How to hide or show options in dropdown B based on selections from dropdown A

How to hide or show options in dropdown B based on selections from dropdown A

I have created two dropdowns A and B. I want to show certain options in dropdown B based on the selection in dropdown A. Is it possible? What is the relevant coding to perform this function?

Please help me

Many thanks