Leave until quite cold, then label and store. As the contents cool they will shrink again and leave a gap.
During the expansion stage it will have pushed all of the air in the gap out through the loosened cap, once you tighten the cap and the contents shrink you will be left with a vacuum which will not allow yeasts, moulds or bugs to grow.
You will now be able to keep your preserve for at least a year at ambient temperature - not in the fridge.
This method is suitable for cordials and things like sauces that have already been cooked and are still hot.
You can use the same process for various fruits which may need a longer time being sterilised - follow the recipe.
Be careful with low acid ingredients like tomatoes and most vegetables - they usually need to be pressure canned which is a different process.