Program which behaves differently in/out of a debugger
x86 and x64_64 machine language on Linux and OSX, 1 byte

0x0:  CC    int3 


Try it online!

int 3 throws a SIGTRAP which will cause a debugger to stop as if it encountered a breakpoint. Outside of a debugger, the kernel terminates the process (thanks to @Ruslan for the correction).

C (gcc) (x86 Linux and OSX), 14 11 9 bytes



main=204;


Try it online!

The integer 204 corresponds to the int 3 instruction; the TIO link is the same as above.