(A guide not a question)
Since most of the tutorials on YouTube are outdated showing how to change the difficulty of a server with a different layout and can be confusing
To change the difficulty of a server, go to the Dashboard of your server and press console you should be able to input a command
Type in "op YourName" which gives you administrative permissions ( so you can input commands in game)
Make sure to not type in "/op YourName" ( at least for me it didn't work when I typed it in with "/")
Then In game type in "/difficulty DifficultyYouWant" (ex. easy, normal, hard)
Example:
> op YourName
[04:35:55 INFO]: Made YourName a server operator
[04:36:06 INFO]: YourName issued server command: /difficulty hard
[04:36:06 INFO]: [3m[37m[YourName: The difficulty has been set to Hard][0m
You can also de-op yourself by typing "deop YourName"
> deop YourName
[04:37:13 INFO]: Made YourName no longer a server operator
As of 29/07/2023 it works
hope it helps