Here is some info I came across for the Elantra GLS model.
"The filter in this transmission is not intended to be serviced. To replace the filter, you must remove and disassemble transmission."
I see transmission filters are sold for the 2002 Hyundai Elantra so you should call an auto parts store to verify. You will of course need the pan gasket and maybe the sealant for the gasket.
Many Japanese cars stopped using trans filters in the late '90. Not sure why Hyundai still does.
The black fluid indicate it has overheated. Transmission fluid is redish.
Here is what one other person found out and was told this filter is not intended for service;
I am working on a 2002 Hyundai Elantra GLS auto transmission filter. I
am stuck. I am surprised to see the filter is vertically positioned
behind the radiator, partially below battery and air duct and air
box , on driver side (left) of vehicle. Normally I expected it
horizontally under the car , like in 1999 model. Instead, it is
vertical. I can remove almost all the bolts except 3 on left side, no
room to get to. First, I drained fluid from bottom plug, Removed
bottom shield. Removed top shield covering battery. Then I see the
black pan of transmission filter vertically. I removed right side ,
top, bottom bolts, The left side bolts are hidden under battery, air
duct and air box. I used rachet wrench, extension, flex adapter, I
still cannot reach those 3 bolts. How do you guys do it? remove
battery, battery tray, then air box, and air hose?