When you want to make a slot across a board, such as for socketing in a shelf, you need something to guide the router straight, and have that guide at a perfect 90 degrees to the edge of the shelf support.
The easiest way to do this is to build a simple "T". To make sure the "T" is at 90 degrees, glue the two pieces, drive in one of the two screws to hold it together, twist it to snug up against a metal square and then drive in the second screw. That will give you a good 90 degrees.
Clamp this onto the a scrap board similar to the board you want to cut the slot into. Make a cut starting from the base of the T towards the open end. Moving in this direction will cause the router spin to hug the router base against the arm of the T. If you make a new T for each of your different sized straight cut router bits, you will discover that you can use the slot that has been cut about half way through the base of the T to line up the jig with your measurements on the final piece of wood. You don't have to worry about where the guide of the T is clamped, the final slot will exactly match the initial slot in the base of the T.
If you need a slot just a fraction of an inch wider than your router bit, perhaps because is has shrunk with repeated sharpening, just place a thin piece of cardboard against the guide rail. This will push the router over by the thickness of the cardstock. Then make the second cut without the cardstock, and the hole will be enlarged by the thickness of the cardstock without moving any clamps.