The phrase "Same way you master the lyrics to a song" is grammatically correct, but "to" is typically used in this context. The phrase "the lyrics of a song" can also be used, but it would slightly change the emphasis.
So, both options are acceptable:
- "Same way you master the lyrics to a song."
- "Same way you master the lyrics of a song."
Choose the one that fits your intended meaning better!