If you are running a Pipeline job, you first want to add a label (e.g. 'slave') to the slave node (or agent as it seems to be called now).
Then, in the pipeline script, you specify the label the job runs on:
Declarative pipeline:
pipeline {
agent {label 'slave'}
stages {
...
}
}
Scripted pipeline:
node (label: 'slave') {
...
}
This job will now run on any node with the label 'slave'. If you only want the job to run on this particular slave, don't reuse the label. And of course the label doesn't have to be 'slave'; it can be whatever you want.
Update:
In the scripted pipeline, if your node is named "My Node", you can also do this:
node ('My Node') {
...
}
If you only want the code block to run on that particular node, this is useful. However, using labels is more flexible, and can make it easier to add nodes to share the workload.