There could be many reasons for this.
1:You have forgotten to include the reference of jQuery library and trying to access jQuery.
2:You have included the reference of the jQuery file, but it is after your jQuery code.
3:The order of the scripts is not correct. For example, if you are using any jQuery plugin and you have placed the reference of the plugin js before the jQuery library then you will face this error.