Get the session number from the command:
loginctl
# It will output:
SESSION UID USER ...
2 1000 yourname ...
2 is the session number
Then, check the display system type:
# Here the session number as above is `2`
loginctl show-session 2 -p Type
# Type=x11
#or
# Type=wayland