Don't let the ruling part of your mind be pushed around by physical pain or pleasure. Keep it separate from these feelings. Let those sensations stay in the body where they belong. But if they do spill over into your thoughts — which happens since body and mind are connected — don't fight the feelings themselves. That's natural. Just don't let your mind add judgments about whether these sensations are good or bad. The pain or pleasure in your flesh means nothing to your true self. If you can avoid judging them, you'll be fine.
Let not that chief commanding part of thy soul be ever subject to any variation through any corporal either pain or pleasure, neither suffer it to be mixed with these, but let it both circumscribe itself, and confine those affections to their own proper parts and members. But if at any time they do reflect and rebound upon the mind and understanding (as in an united and compacted body it must needs;) then must thou not go about to resist sense and feeling, it being natural. However let not thy understanding to this natural sense and feeling, which whether unto our flesh pleasant or painful, is unto us nothing properly, add an opinion of either good or bad and all is well.