Timeline wise, 'good' would come first. But go ahead and watch them in order of release. It gets better with each movie. But give it some time after you watch for a few dollars more, and good bad and the ugly. Why? A good guy from one, is bad in the other. You'll see, but it can be awkward.
The order doesn't matter; these are standalone movies and the events of one have no bearing on the other. The same actors play different characters in some cases. Some argue that the films take place in the reverse of the order in which they were released, which is valid, but I typically just watch them in release order; you see how Leone improved in his filmmaking over time with bigger budgets and plans over time.