You've got to have plans in the opening. General rules for openings are, control of the centre, develop your pieces and castle.
However when you make moves such as Be3 infact your blocking in pieces and making it harder to castle and moves such as g4 are juse giving away a pawn, weakening your pawns and allowing black to develop his pieces. So before you move any piece just ask yourself what is the point, can it be taken, is the piece I'm moving protecting something else etc etc
It's a little hard to begin with, but you'll soon pick it up and begin to see more. Just use google and I'm sure you'll find some good tips