what is the language technique when 2 words are similar and are put together in a text?

The language technique you may be referring to is called "onomatopoeia". It is when words are used to imitate or suggest the sound of what they describe. Examples in English include words like "buzz", "hiss", and "crackle". However, if the two words are not necessarily imitating a sound, it could be a form of wordplay or pun.