Whenever I needed to find the inverse of a matrix, I was told to check if its determinant is not zero. However, once I directly applied the Gauss-Jordan's method for finding the inverse of matrix whose determinant was zero. The inverse matrix that I got looked pretty normal like any other (if there wasn't a mistake).
I want to know how does the determinant of the matrix is related to inverse of matrix or why is that if determinant is zero then inverse doesn't exist? What exactly is inverse?
The inverse of a matrix exists if and only if the determinant is non-zero. You probably made a mistake somewhere when you applied Gauss-Jordan's method.
One of the defining property of the determinant function is that if the rows of a nxn matrix are not linearly independent, then its determinant has to equal zero. In fact, the determinant function is constructed based on several desired properties(one of them being if the rows are dependent, its determinant is zero).
To answer your question what exactly is an inverse, Let's say if A is a nxn matrix, then its inverse is a matrix such that AB = BA = I. They don't necessarily exists though.