Generics for groceries and cleaning products, paper products, etc. are probably fine and they are much cheaper.
But as far as prescription drugs are concerned they are not the same. They contain the same main ingredient but the generics use cheaper fillers, the tablets are compressed differently, different colourings, etc. They do not work the same as the brand name drugs. Some can cause terrible allergic reactions and land you in the hospital fast. Generics are not recommended for heart meds, some neuro drugs have adverse effects. Some generics that aren't for serious problems can be used and will be effective but for serious health problems generics are not the way to go.
When my doctor writes out my scripts he always adds "do not subsitute" at the bottom of the script.