I used to make my own chilli oil (for cooking with) from home grown chillies. Made with fresh chillies it can go mouldy within a few days even in the fridge (though sometimes it lasts longer) so the first factor is use thoroughly dried chillies.
I grow my own, and used to mainly grow Apache. This is a moderately hot, thin-fleshed variety, and it's ideal - the thin flesh dries well while the heat is sufficient for most things without too much risk of being overpowering. Drying is best done outside because the capsaicin fumes are a bit much indoors. I use a dehydrator on a sunny day.
I do encourage you to read up on the botulism risk. My personal assessment after some reading of the scientific literature was that combining pH adjustment, refrigeration, and only using the oil when it's getting cooked, the risks are negligible. Guidance in some countries says otherwise, and that's reasonable because no step in the process is foolproof. I have given up not so much because of the risk, as because I don't have much fridge space. Now I make chilli flakes instead, and add them to the oil at the start of cooking. The effect is very similar. If you want preserved chillies for pizza, pickling then works very nicely.