SQL Server – SQL – work locally instead of public ports

My database and my web application are currently on the same server and I want to access SQL Server as localhost and close the SQL Server port for remote connections.

This is my current connection string, how can I change it to access the database as localhost?

"ConnectionStrings": {
    "DefaultConnection": "Server=tcp:;Initial Catalog=testdb;User ID=usera;Password=********"

I have tried:

Data Source=(local)

using Data Source=(local)\SQLEXPRESS
I got this message:

A connection has been established with the server, but a connection
an error occurred during the login process. (provider: shared memory
Supplier, error: 0 – No process is at the other end of the pipe.

Using SQL Server 2017.