I was listening to a lecture and it said that Allah swt before creation there was nothing just Him (Exsalted be Him). So there was nothing but Him? I’m just confused but maybe I shouldn’t be thinking about Allah swt is such way because it takes me through a rabbit hole.

In fact, you should not think about these matters, not because that is a disruption of thought, but because you will not reach anything, and the matter will lead you to deny the Creator, and the reason for that is that you are limited, and the limited cannot come out of his limitation to surround the unlimited.
Therefore, we are forbidden to contemplate the Essence of God Almighty