To mark or unmark a recipe as favourite, you need to have a filter slot active in your inventory. Use the middle mouse button to set the filter for the recipe in your inventory, then craft the recipe you want to set as favourite.
Do remember to unset the filter, or your next craft will remove the item from favourites again.