I wonder whether we can withdraw a manuscript after its acceptance but before it has been published online.
As noted by @Joe_74, it is possible but very bad form. If there is not a good reason for such withdrawal, the authors are subject to poor reputation at a minimum and sanctions (such as a ban) at a maximum. You haven't said why you wish to withdraw. As Joe said, if there is an error, it is unfortunate, but withdrawal is probably best. If it's like another recent post, and it's because of simultaneous submission or some other less ethical behavior, you would deserve whatever comes your way.
It may depend on the tacit agreement between the journal and the author(s) that you agree upon when submitting the manuscript.
However, if you motivate soundly this choice (eg quoting errors in data or analyses), most journals will unwillingly accept the withdrawal.
However, this may largely undermine your credibility with the journal, its editors, the specific reviewers, and the publisher.
There is a related post here: Is it ethical to withdraw a paper after acceptance in order to resubmit to a better journal?
And for those submitting to Elsevier journals, this publisher has some specific guidelines on how to handle similar cases: https://www.elsevier.com/about/our-business/policies/article-withdrawal