When engineering microscopic machines, increasing efficiency can often come at a price of reduced reliability due to the impact of stochastic fluctuations. Here we develop a general method for performing multiobjective optimization of efficiency and work fluctuations in thermal machines operating close to equilibrium in either the classical or quantum regime. Our method utilizes techniques from thermodynamic geometry, whereby we match optimal solutions to protocols parametrized by their thermodynamic length. We characterize the optimal protocols for continuous-variable Gaussian machines, which form a crucial class in the study of thermodynamics for microscopic systems.