You really have three separate problems to solve, though it sounds like you're talking about only one of them. The total package is known as GNC, or Guidance, Navigation, and Control.
A little more detail on the issues at play:
Guidance: in which we try to figure out where we want to be
This is entirely mission-dependent. Some missions just need to be in orbit -- nearly any orbit will do. Other missions need precise positioning and timing. Obviously, you would need to work this out before you even think about launching, as it affects nearly everything about your launch: what booster you use, your launch site, the precise timing of your launch.
You would design a target trajectory ahead of time that will get you to your target within the constrained resources you have available. The computer on board your vehicle would have this programmed in, along with a means to adjust to changes in performance and environmental effects. Very often, this means having two or three distinct flight phases from a guidance perspective:
Atmospheric flight guidance is very often simply about getting out of the atmosphere in generally the right direction and in one piece. Generally speaking, you launch upward enough to clear ground obstructions, then you turn on an azimuth that will get you to the desired orbital plane. If you launch late or early, your guidance system would have to be smart enough to know how to alter the direction it initially points to make up for the rotation of the earth over that time.
Once you're on your way, you typically adjust your engine throttle
and positioning to gain some altitude and downrange velocity while
keeping aerodynamic loads low enough not to crush the vehicle. This usually means throttling back as your speed increases, until the atmosphere becomes more rarefied. It also means keeping your angle of attack and sideslip angles within very tight bounds -- if the vehicle goes too far sideways to the breeze, it will disintegrate. At this point, loads management and general direction are more important than precise trajectory targeting. Guidance at this point is often "open loop", a prescribed set of attitudes as a function of velocity. This approach to guidance often lasts the entirety of the first stage burn.
Once the first stage is done (or boosters are separated), the second phase of guidance takes over. Chances are that by this point, you've deviated somewhat from your planned trajectory. This is due to many factors, including winds aloft, deviations in atmospheric density, and (especially if solid boosters are used), deviations in engine performance above or below what was planned.
Now it's time for your guidance system to recalculate the trajectory it has to take -- guidance enters the "closed loop" phase. You are now targeting a precise position and velocity target, and it's your job to ensure you hit it as closely as possible. Hopefully, you haven't deviated too far from your original planned trajectory -- recalculating your trajectory is much easier if you only have to make small tweaks.
AT this point, it's a game of determining your state vector (see Naviation, next), calculating the difference (the error or residual) between where you are and where you should be along the trajectory, and adjusting your engine throttle and gimbal angles to correct that error. You will do this over and over, several times (maybe hundreds of times) per second. When you hit the precise velocity and position you want, you cut the engines.
All this while, you have one other important concern: as your tanks become more depleted of fuel, your vehicle gets lighter and lighter, yet the engine keeps the more or less same thrust for a given throttle level. You may have to throttle your engine back to keep the acceleration loads within acceptable limits. You may also need to be able to reach an acceptable orbit should an engine not perform to expectation (or even fail entirely). These would all be planned for well before you even put the vehicle on the launch pad.
Finally, you have your on-orbit guidance. At this point, it's a matter of making precisely timed burns to adjust your orbit to reach or maintain the desired final destination. From a guidance perspective, most of this time is spent waiting, as the effectiveness of orbital maneuvers depends greatly on when they are made. Management of temperature, power, communications, and payload instruments becomes the primary concern for vehicle orientation until you get near the prescribed burn time. You want to keep your solar arrays (if you have any) pointed at the sun, your vehicle pointed properly so it's not too hot or too cold, your antennas pointed where you need them (probably at earth), and whatever payload sensors pointed at whatever they need to be pointed at. Anything beyond this is going to be mission-specific.
Navigation: in which we try to figure out where we are
This is primary a sensing problem. Most space and launch vehicles use some form of Inertial Measurement System, which takes a precisely known starting point and uses extremely accurate and sensitive accelerometers and gyroscopes to measure all of the forces and perturbations the vehicle experiences. Integrating these over time will provide you with a state vector, which contains information about your instantaneous position, velocity, and orientation, even in the absence of any external reference.
Because there is no such thing as a perfectly error-free accelerometer or drift-free gyroscope, you will need some sort of external reference to correct your state vector, as these errors will accumulate over time. For orientation, the most common solution is a star tracker, basically one or more precisely aligned cameras affixed to the vehicle, which are used to find the location of selected stars to provide a more-or-less fixed orientation reference. If you are staying within Earth orbit, you can also use GPS to help keep your position reference updated. If not, you'll have to use some other reference. Your specific choice will depend on where you're going -- it's possible that, for your desired accuracy, "nothing" may be good enough.
Control: in which we figure out how to get from here to there
This is where the crux of your question comes into play. Given a guidance residual, what do I need to do to zero it out? What angle do I need to point the engines at? What positions to I need to command various actuators to make that happen? What thrusters do I need to fire? What valves do I need to open, close, or adjust? How do I take into account that the rocket isn't a rigid body but really a giant floppy noodle? How do I make sure that the liquid fuels I have in my tanks don't slosh around and throw me off course? How do I ensure that the engines maintain the proper mixture of fuel and oxidizer? How do I take into account the lag time between command and response for any given actuator? Do I need position feedback on all my actuators, or is open-loop positioning good enough on some of them? Can my control scheme adjust if something is out of alignment?
While I'm sure you could come up with a relatively "rocket-agnostic" framework for a control system, every vehicle is going to have its own nuances and "funnies" that you have to account for. Ultimately, this is a classical controls problem. You just have to make sure that the open-loop responses of the vehicle are well-characterized so you can create a control scheme that effectively directs the vehicle and accounts for anything that is not precisely "as drawn".