Assertion is to check whether the actual result is the same as compared with the expected result. In case the assertion fails, then the test case is failed and will stop the execution.
There are two types of Assertion:-
Hard Assertions: Hard Assertion that throws the AssertException when the test case is failed
Soft assertions: Soft assertions do not throw an exception if an assertion fails and continues with the next step after the assert statement
If you are interested to learn Selenium, I recommend this Selenium Certification course by Intellipaat.