"Hello, I pressed the initialize button."
That's not a good thing to do unless you want to erase the drive and everything on it.
"I'm using an apfs type of external ssd.
I wonder if it can be restored."
APFS -and- an SSD?
And you erased it?
The chances... well, let's say they're not very good.
Maybe a little better than zero.
Were you using any encryption on the drive?
In that case, you aren't getting the data back. Period.
There are "data recovery companies" that might be able to get it back, but you are going to pay lots and LOTS and LOTS of money. Is it really worth it?
There are "data recovery" apps out there, like Data Rescue and Disk Drill.
However, I don't believe they can work with APFS -- only HFS+.
That's WHY I always recommend that if one is going to store data on an external drive, it should be in HFS+ format -- because disk maintenance apps can "get at it". APFS -- might as well forget it.
So... what can you do?
First off, don't do anything with the drive -- don't write any files to it.
I'd suggest you try downloading BOTH Disk Drill and Data Rescue.
See if they can do anything with the drive.
But again... I wouldn't be optimistic about this...