How do I avoid shaving bumps?!

Hey gals!

I did a test patch shaving my bikini line yesterday, I haven’t done it for a couple of years. I used foam but still have the little red bumps, I just wondered if anyone had any tips of how to avoid them? They look kinda gross, and defeat the object of me shaving 😩

helpppp! Much appreciated 💖