Set up the dimensions first, then find the “conversion factors” .
It is most important to set up any equation in terms of the dimensions before you apply the values! The math will always result in some number, but it will only be correct if the dimensions are also properly aligned.
The mass conversion needed is grams to pounds. That is 454g/1.0lb.
The volume conversion is mL to gallons. This can be obtained from the L/gal value first: 3.785 L/gal.
3.785L/gal * 1000mL/L = 3785 mL/gal.
Put these together in a way to give you a lbs/gal dimension from the g/mL dimension: