How to get permissions on a Minecraft server?

I made a server and I want to be able to change the difficulty and game mode and use other commands. Whenever I try a command it says "You do not have permission to use this command." I already tried to OP myself but it still wouldn't let me use commands. How do I gain permission?

Added (1). Please be detailed as I'm not a computer expert.

Added (2). I already tried typing /op (username) into the console and on the server it even said that I had become an OP. It still wouldn't let me use commands.

Two ways, first you can type "/op username" into the console (the window that pops up when you start the server) without the quotation marks and with your username in place of the word username. Otherwise you can go into the server folder, find the text file named ops, and make sure your username is in there. The only time that permission text should come up is if you are not an op, so I can only imagine that you oped yourself incorrectly.