See documentation here but don’t miss the note 2 and the following points :
- AJAX on the front-end is more complicated, ajaxurl is not defined so
you have to call it with wp_localize_script(). - you have to use wp_ajax_nopriv_{action} for non logged in users
- there could be security issue !!!
About the third point :
Be careful because you give access to non logged in users to some data and functions. So you need to ask yourself about what you want to do. It could seem a little bit too much but to me when using AJAX on the front-end of WP you should make $_GET things, only for reading, for example infinite scroll ans stuffs like that, not delete, create and update actions.