I went to the supermarket to buy eggs, but I started looking at other things, then I forgot to buy my eggs.
この場合、次のような言い方ができますよ。
ーI went to the supermarket to buy eggs, but I started looking at other things, then I forgot to buy my eggs.
「卵を買いにスーパーに行ったのに、他のものを見始めて、卵を買い忘れた」
to go to the supermarket to buy eggs「卵を買いにスーパーに行く」
to forget to buy me eggs「卵を買い忘れる」
ご参考まで!
I forgot to buy what I needed. (必要だったものを買うのを忘れてしまいました。) という表現が分かりやすいです。what I needed で「自分が必要としていたもの(買わなきゃいけないもの)」を指すことができます。
今回のように、卵という具体的な目的があったのに買い忘れて帰宅してしまった場合は、 I totally forgot to pick up the eggs. (卵を買うのをすっかり忘れていました。) と言うと、うっかり感がより伝わります。pick up は買い物で「(ついでに)買う、手に入れる」という時によく使われる便利な熟語です。