The key component is some measure of psychological reluctance or indifference. We'd previously agreed that we'd fuck on Saturday, but now it's Saturday and both of us are feeling a whole lot more "well, I said I would" than horny. I feel like I ought to, not like I want to. Or I feel like I ought not, and rather than gleeful naughtiness I've fallen into crushing guilt. Or I feel like I'm not attracted to him, but he's better than nothing.
Lack of body confidence definitely helps tremendously. Nothing guarantees terrible sex quite like the thought "I'm not what he wants, but he's settling for me." Turn out the lights, make little apologetic comments about your gut or your acne, go through contortions to hide the problem areas. Ask him if he finds your horrible flaws even slightly attractive and don't take "yes" for an answer.
There's two ways you can go with the foreplay. You can go way too short, and try to start when everything's still dry and limp, or way too long in the face of failure. The second method is definitely more effective in creating an atmosphere of real desperation and inadequacy--repeat the same one or two uncreative strokes over and over for hours, hoping to win over the genitalia by sheer persistence. Whatever you do, don't change it up, and for God's sake don't relax or take a break.
If you've followed these steps psychologically, physical failure is close to a given. Apologize profusely for this. Perhaps turn away from the other person and attempt to self-stimulate in front of them, but make sure to see this as a humiliating last-ditch rather than an erotic action and you're sure to fail at this too.
Should you achieve penetration, you can at least fail at orgasm. Fuck for a while--silent and monotonous are your key themes here--and give up.
Do not, however, give up on your partner. Refuse to let them even try for your orgasm, but put them through a declining series of sex toy, give up on sex toy, mouth, give up on mouth, hands, exhausted listless hands. If you're dogged enough you might get them to fake one just to make you stop.
Sleep far away from each other.