Best recommendation is to use the builder pattern as done with the NuGet package SqlKata with documentation here.
Simple select code sample getting data from two ComboBox controls SELECT * FROM [Contacts] WHERE [FirstName] = @p0 AND [LastName] = @p1
using var cn = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=NorthWind2020;Integrated Security=True");
SqlServerCompiler compiler = new ();
var db = new QueryFactory(cn, compiler);
var query = db.Query("Contacts");
// add first condition
query = query.Where("FirstName", ContactFirstNameComboBox.Text);
// add another condition
query = query.Where("LastName", ContactLastNameComboBox.Text);
SqlResult result = compiler.Compile(query);
// this is the SQL statement parameterized
string sql = result.Sql;