How to send AJAX request from WordPress theme

AJAX makes easier to perform operations without submitting the form like – fetch, insert, delete records from MySQL database, file uploading, etc. Using AJAX in WordPress is a little different. Here, need to consider two things –

Source