Depending on the case, I would probably use dynamic SQL.
However you need to remember about SQL injection in case @param originates from a user, thats why you should never add a parameter directly to your sql.
In t-sql it would look something like (out of my head and untested ;):
DECLARE @SQL NVARCHAR(MAX)
SET @SQL = N'
SELECT ...
FROM table t
WHERE 1 = 1' (
IF(@param IS NOT NULL)
SET @SQL = @SQL + '
AND t.id = @id'
... possibly more things added to the query ...
EXEC sp_executesql
@SQL
, '@id AS INT'
, @id = @Param
By doing this, you will get an optimized query plan for each case (and by using sp_executesql, the query cache will be used as well)
I would especially avoid the OR solution, if you check the query plans generated with the OR compared to one without, you will understand why.