Here is the code that I use. I added the NuGet Package in Visual Studio so I don't need to specify the path of the geckodriver.exe.
case "Firefox":
if (Driver == null)
{
var driverService = FirefoxDriverService.CreateDefaultService();
driverService.HideCommandPromptWindow = true;
driverService.SuppressInitialDiagnosticInformation = true;
FirefoxOptions options = new FirefoxOptions();
options.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true);
driver = new FirefoxDriver(driverService, options, TimeSpan.FromSeconds(30));
}
break;