First clear your plan with your health professional, grab your crutches and non weight bear your way to the gym.
Take it slowly and be safe in your exercise selection and execution. If you forget about your weight bearing restrictions for a moment or a loss of balance requires you put weight through your foot it may not end well tho probably won’t be the end of the world.
Machines come to mind immediately as being helpful. Machines that allow you to support/balance/stabilise your body without using your feet e.g. chest supported rows, bench press machines which support your back, etc. can allow you to maintain adequate stability with no feet on the ground never mind one.
However free weights can be modified also to be safe/er. For example on the barbell bench press the legs are often placed on the ground and “leg drive” is often used where in force is put through them. However if you place a box or stack plates at the end of a bench you can rest your legs out straight.