The assert_eq function is automatically imported into every program from the prelude. It takes two expressions which are compared and the result is a Boolean. If the value is false then the virtual machine will revert.
Here is a function which asserts that a and b must be equal.
{{#include ../../../code/operations/assertions/src/lib.sw:assert_eq}}