Arduino code to attiny45 code

Essentially. https://youtu.be/po26pBxQp7Y

When you program in Arduino, there is a "implementation" layer of code and functions called the core that manages the low-level magic. The core and your sketch and library code gets compiled by Arduino scripts and gets uploaded to the uC collectively as "firmware."

Over the years, several attiny cores have been created:
Which core for ATTiny85? - Using Arduino / Microcontrollers - Arduino Forum