"How do I use hopefully the right way?"

Some English speakers will say that in sentences like Hopefully, we'll finish the project on time, the adverb hopefully is not being used correctly. Such people point to hopeful, the adjective that hopefully is supposed to come from, and note that this adjective means 'hoping' or 'full of hope', as in She was hopeful that she would get the job (in other words, she hoped she would get the job). From this, they argue that hopefully can mean only 'in a hopeful manner' which applies to the action performed by the subject of the sentence; thus Hopefully, she waited for word from the company means she was hopeful as she waited, or she waited "in a hopeful manner."

But grammatical arguments like this based solely on word formation or etymology (word history) often simply do not jibe with the realities of language usage. The fact is that hopefully has acquired a meaning and use independent from that of hopeful. As it's used in contemporary American English, hopefully gives our opinion or evaluation of the situation described in the sentence. Another word used in this way is regrettably, as in Regrettably, John didn't take her advice. If you say this, what you mean is that it is regrettable or you regret that John didn't take her advice; you don't mean John rejected her advice in a regrettable manner. Similarly, hopefully means roughly 'I hope that' as in Hopefully, Jane will realize that she's wrong; it clearly doesn't mean that Jane will realize she's wrong "in a hopeful manner."

In spite of such reasoning, many people will still insist that hopefully is wrongly used in a sentences like Hopefully, Jane will realize that she's wrong because, they maintain, hopefully "must" apply to the subject of the sentence, Jane, and mean she is hopeful. My advice is just to remember that many people have been taught that using hopefully in this way is "incorrect" and you should be careful using this word yourself.