I used the Elmer’s gel glue (it’s light blue), the instructions said that regular glue would not work. You want to dampen the onesie/t-shrit first, and squeeze extra water out. Apply the glue in whatever writing, shape you want, while the article is wet, and let it dry completely. Then dye your shirt or onesie. I was after a tye-dye look, and didn’t want a uniform dye job, so that is why mine looks uneven!
I found that the glue spreads a bit-so I recommend using the minimal amount of glue you can. Good luck!
Here is the blog that I first saw this procedure done: