Can I change employer while H-1B petition is pending? I am currently in the US on F1?

I am currently on f1 Visa and graduating in May.

My H1b with consular processing has been applied by my future employer. Now I have a
very good offer from another employer.

Can I change the employer now? Will this affect my F1/OPT status?

I Am ready to withdrawn H1b from current employer. My new employer ready to file H1B for me next year.

Go and join the future employer using your F-OPT. If your H1 is approved before Oct 2019, you can have your future employer file a new H1 (you wont come under cap of 2019 quota).
If your H1 is approved AFTER Oct also, you can have your future employer file H1 visa(non-quota again) IMMEDIATELY after your current H1 approval.
This way, you will leverage your quota-approved H1B this year and safely continue to work for your Future Employer.

Hello,

Thank you for your answer.

I have to join employer B in Mid June and Ready to give up H1B from employer A.
So my question is: Is there a procedure to withdraw application filed by A? Will this affect my F1/OPT status by any chance OR next H1B filled next year by the employer B? (Does USCIS red flag or something like that?)

If its your first H1B off CAP, you may be at loss if you withdraw it. Since your new employer cant make use of it to apply(in other words Transfer) your H1B visa.
If not, you can safely request a withdrawal of pending petition.

Hello,

Thanks for your answer.

Yes, This is my first H1B. Also, What happens when employee A submit withdrawal request meanwhile it got to accept. Will this affect my F1/OPT status by any chance OR next H1B filled next year by the employer B? (Does USCIS red flag or something like that?)

It doesnt affect any of your existing status (F1/OPT).
Also there will be no negative impact on your next year H1 filing(even with the same employer OR another employer)
But again, you would lose your H1 CAP selection of this year.
Next filing comes under CAP(lottery etc).

If my Employer A does not withdraw H1B then from October 1, I will be in H1B, right? And since I joined employer B and not employer A, I will be out of status and go home. Is that right?

Your Employer A H1B visa must be approved with that employer only, to get you CAP H1B visa number.