If you're trying to lose fat(cut), eat at a deficit.
If you're trying to build muscle(bulk), eat at a surplus.
You may need to eat at a surplus first and build muscle, and then once satisfied with your build you can eat at a deficit to cut the extra fat. It all depends on your goals.