No, the code you have mentioned isn’t correct. If you use that code, it will drop the table only if it contains any rows and it’ll result in an error if the table does not exist.
You can refer to this video for DROP Table.
You can use this code instead of a permanent table.
IF OBJECTA_ID('dbo.Scores', 'U') IS NOT NULL
DROP TABLE dbo.Scores;
Or
Are you interested in learning SQL from scratch! Have a look at this interesting video on SQL provided by Intellipaat:
For a Temporary table you can use this code:
IF OBJECTA_ID('tempdb.dbo.#T1', 'U') IS NOT NULL
DROP TABLE #T1;