It's not a formula, but there are ways to make sure a vocal line fits well with a rhythm or beat.
Here's a map of a typical beat/rhythm, showing where the musical stresses fall:
ONE and Two and THREE and Four and
Usually the first beat of every measure is the strongest, then the third beat is second strongest, and then the second and fourth beats are less strong than the third beat, and the off beats ("ands") are the weakest.
Now let's do the same thing with the same vocal line you posted:
I got wood-grain on my Damier Buckle, Cool quarter mill in my Goyard duffle
I've never heard the song before, so I don't know how it's set to music, but I know right away how I would set it to music:
1 & 2 & 3 & 4 &
I got wood grain in my Dam- ier Buck- le
1 & 2 & 3 & 4 &
Cool quarter mill in my Go- yard duff- le
There's more than one way to do it, but the important part is that generally, the stressed syllables in the lyrics should line up with the strongest beats in the music. Usually, if your lyrics sound "off" in some way when you set them to music, the first place to look is at the stresses in the lyrics and how they line up, or don't, with the stresses in the beat.
Sometimes it's hard to know what syllables are stressed in the lyrics. The trick for figuring it out is to forget about the music completely and just say the lyrics like you're just talking to someone. Say it at least three times, each time trying to let go of the music and say it as casually as possible. Starting on the third time, listen carefully to how you're saying it. You should be able to hear and feel which syllables you are stressing.