How to convert 9v supply to 5v?
For low power load applications (such as your case) you could use voltage regulator
https://www.soselectronic.com/productdata/17/71/6/17716/L78S.pdf

For more demanding devices use switching step-down regulator
https://www.soselectronic.com/productdata/93/80/4/93804/ltc1767.pdf

Take the links as example only.