You should consider the help of an instructor. Personal, direct instruction should correct your issue quickly.
If that's not possible for you, you can try to shift the position of your chest and shoulders until you can find a comfortable position where you can stroke the cue straight, and you're stable. When you shift your chest and shoulders, you can change the height, position left/right, forward/backward, and the angle, of your shoulders in relation to the cue. Let your feet, legs, and hips move freely to accommodate your changes. Forget what you may have been taught about where to position our feet, how to distribute your weight, etc.. Experiment. Everybody is physically different, so you need to find your own shooting position that works for you.
You will have to make sure your head and eyes are positioned properly to aim accurately when you find that new comfortable position.