If I were to boil down the thing I have gained in those three years -- of struggle I might add -- in grad school, I would say: never give up, no matter how bad things may seem, or how nothing is going your way, have trust and faith that it will eventually work itself out if you focus and keep going.
You have to have faith in yourself and your capabilities, it'll all be worth it in the end. trust me.