ɡ vs g
ɡ
Voiced velar plosive
U+0261
g
Latin small letter g
U+0067
How to tell them apart
ɡ is always single-storey. In a font whose g is double-storey (many serif fonts) you can see the difference; in a font whose g is single-storey they are identical, so check the code point.
ɡ
Use ɡ for strict phonetic transcription, where the IPA prescribes the single-storey (opentail) ɡ so it is never confused with a looptail g; in practice many sources transcribe with the plain letter.
g
Use g for ordinary text in any language: the letter g, whose shape (single- or double-storey) depends on the font.