Best way to store flour

What’s the best way to store flour, sugar , corn starch etc..? I’m new to the cooking world ( I know, it’s sad ) . Today I opened up a unopened bag of all purpose flour and there were black Tony bugs inside! So gross! Then I got paranoid and checked my sugar bag but thankfully no bugs. Are there tubs that I can buy to store these items instead of keeping them inside a bag?