In order to comprehend the mechanisms of assimilation some comprehension of the production of speech sounds is needed: Roach, P., English Phonetics and Phonology (4th ed.), Cambridge, CUP, 2010, is recommended.

The most common form involves the movement of place of articulation of the alveolar stops /t/, /d/ and /n/ to a position closer to that of the following sound. For instance, in the phrase ten cars, the /n/ will usually be articulated in a velar position, /ˈteŋ ˈkɑːz/ so that the organs of speech are ready to produce the following velar sound /k/. Similarly, in ten boys the /n/ will be produced in a bilabial position, /ˈtem ˈbɔɪz/ to prepare for the articulation of the bilabial /b/.

Before a bilabial
Phoneme    Realised as    Example   
/n/ /m/  ten men /tem ˈmen/
/d/ /b/  bad boys /bæb ˈbɔɪz/
/t/ /p/  what presents /wɒp ˈpresənts/

Before a velar
Phoneme    Realised as    Example   
/n/ /ŋ/  green grass /ˈɡriːŋ ˈɡrɑːs/
/d/ /g/  good girl /gʊg ˈgɜːl/
/t/ /k/  that kid /ðæk ˈkɪd/