SQL injection check

What is the best way to check and remove sql injections before sql query.
Is there any built in funxtions?

https://discourse.hkvstore.com/t/executescalar-sql-best-practice/8272/2