He was told to shut up. He clamored all the more. She was told she was dog. She asked for a crumb off the table.
What do you do when God appears to say no? Bartimaeus kept asking. In fact, he yelled all the louder (Mark 10:48). The Canaanite woman didn’t get mad. She said, “Yes, but…” Jesus tested her strongly. First he didn’t even talk to her. Then He mistreated her. She kept insisting. Even the “dogs” get crumbs off their masters’ tables. This impressed Jesus. “Woman, you have great faith! Your request is granted,” he said (Mat 15:28).
It’s hard to know when “no” is truly and definitively “no” from God. So if what you are asking for doesn’t contradict the Word of God, keep asking and patiently believing. You could ask for something that God won’t give you. But the other extreme is worse: you could lose heart and faith and stop believing.