Most of the time I leave scheduling to the kernel. When one heavy process keeps dragging everything else down, taskset is a quick way to keep it on a few cores.
Start a command restricted to cores 0 and 1. The -c option makes taskset read the argument as a list of processors instead of a bit mask:
taskset -c 0,1 ffmpeg -i in.mkv out.mp4
The lists can include ranges, so 0-2,6 means processors 0, 1, 2 and 6. Without -c the same cores would be written as a hex mask, where 0x00000003 is processors 0 and 1.
For a process that already runs, use -p with its PID. The man page shows that without a mask it prints the current affinity, and -pc prints it as a list instead of a mask:
taskset -p 1234
taskset -pc 1234
taskset -pc 0-3 1234
The first line prints the current mask, the second the same thing as a list such as 0-47 and the last one changes the affinity of process 1234 to cores 0 to 3.
An affinity is a limit, not a reservation. Pinning a process to two cores does not keep other tasks off them. It can also make the job slower if you give it fewer cores than it could use, so it only pays off when you know why you are doing it. For limits that must survive a restart of a service, the systemd setting CPUAffinity= is a better place than a command you run by hand. When the goal is priority and not placement, nice is the tool to look at.
Further reading: taskset(1) manual page