Hopefully this is a beginner-friendly post. This is from the perspective of jazz music as it is practiced today. Jazz music from the 1920s and 1930s often uses more classically oriented rules, but since the end of WWII, the following points are valid.
Point #1. When you see a dominant chord, e.g. C#7, with additional alterations, e.g. C#7b13, it is common for people to infer and play other altered extensions - b9, #9 and b5/#11.
Point #2. These alterations are derived from accommodating melody notes. E.g., C#7b13 use the note A, the third degree of F# minor, so if the melody contains A over a C#7 chord, that is where the alteration comes from. Note that today, it’s often common practice to use this chord in any context, e.g. F# major, just to add flavor.
It’s worthwhile to spend some time studying these extended chords at a keyboard to familiarize oneself with the sounds. I recommend Mark Levine’s excellent Jazz Piano Book as a source of ways to voice these chords. Mark never ever played a bad voicing in his life. I have found that studying good voicings for dominant chords has informed my melodic improvisation greatly.
Point #3. The melodic minor scale should not be thought of in the context of harmony, it is for melodic use. That is why in classical theory there is the harmonic minor scale and the melodic minor scale. The name says it. Note that today, the melodic minor scale is often used in the ascending version only; that is, the same notes are played going both up and down.
Also, this scale has many uses besides just starting on its root note, but that is beyond the scope of this post. (Side note - I have an objection to terms like “the 7th mode of the melodic minor scale”. Mostly because I think that it’s a bad idea to conflate the idea of a “mode” with that of a “scale”. I understand this is a quirk of mine, but I’m old and thus allow myself a large degree of quirkiness.)