The intention (niyyah) is an essential pillar (rukn) of ইহরাম — without it, you are not considered to be in the state of ইহরাম regardless of what you are wearing. Niyyah is made in the heart, not necessarily spoken aloud, though some scholars recommend verbalizing it. You must specify whether you intend হজ্জ, উমরাহ, or both (Tamattu/Qiran).
If you realize you have passed the Miqat without making the intention, the correct course of action জমহুর উলামাদের মতে is to return to the Miqat and enter ইহরাম from there before proceeding. If you return and enter ইহরাম from the Miqat, no penalty is due. However, if returning is genuinely not possible (e.g., on a flight that has already landed, or logistical impossibility), you should enter ইহরাম immediately from wherever you are and pay a fidyah — which is to sacrifice a sheep in মক্কা মুকাররমা.
It is important to distinguish between forgetting the niyyah entirely and simply being confused about the type of হজ্জ. If you made a general intention for হজ্জ but forgot to specify the type, most scholars say your ইহরাম is valid and you can specify later. To avoid these issues, make your intention clearly before reaching the Miqat, and if traveling by air, set an alarm for well before the estimated Miqat crossing time.