Just add the discriminating property to the first match clause
MATCH (s:Student {id:1})
OPTIONAL MATCH s-[r]-()
DELETE r, s
If instead by id
you mean the internal node id and not a property that you have set, then
MATCH (s)
WHERE ID (s) = 1
OPTIONAL MATCH s-[r]-()
DELETE r, s
should work. It is irregular and usually bad to lay hold of nodes by their internal id.