The question is a little confusing, just look at this example of gradient that I want to make.
This what I have tried, I used mesh tool for 4 sides of the rectangle with 4 colors but didn't give a result that I expected
What should I do properly, I'm new to Illustrator