To put it very simply:
O sounds like A when it is not stressed.
The Russian letter O is pronounced [o] when it is stressed and it is pronounced like A [a] or an unclear schwa [ə] when it is not stressed. This is called vowel reduction, and it is an important rule of the Russian pronunciation.
For example,
-
она (she) sounds like [ana] because O is unstressed.
-
однообразный (monotonous) is pronounced as [adnaaˈbraznij] because none of the O's is stressed.
-
облако is pronounced as [ˈobləkə] because stress falls on the first O.
As you can see, the stressed O sounds like [o] and the unstressed O sounds like either [a], [ɐ] or [ə]. By the way, the unstressed A is also reduced from the full [a] sound to the reduced A [ɐ] or an unclear schwa [ə].
If you're a native speaker of English you can compare the unstressed Russian O with the unclear schwa sound [ə]. That's the sound of the -er for professions, e.g. teachER.
To pronounce O correctly, you need to know which syllable is stressed. This can cause confusion for beginning students of Russian because spelling doesn't give any indication of stress. You may need to look it up in a dictionary. But many textbooks and sites for Russian learners will mark the stress for you with an accute accent mark that is placed above the stressed letter like this: о́блако (cloud). Other sites can underline the stressed letter or mark it with color or bold font.
There are some exceptions to the above rule. For instance, [o] is not always reduced in words borrowed from other languages, such as in радио [ˈra.dʲɪ.o] (radio).