why cant i break blocks in Minecraft but still kill animals? [duplicate]

I just logged in to Minecraft after maybe 8-9 months at the most. When I first logged in, I tried to switch between modes but I forgot how, so I looked for it and it said to press F1. Before I did I could destroy and place blocks, but now I can't destroy them! Is this common, and does anyone know how to fix it?
And btw, whenever I go onto a bare hand to destroy something, it just goes back to the first item in my inventory.


Solution 1:

First things first.

F1 makes your Minecraft become into like a Camera Mode. It removes your inventory and hand that you can see again if you press F1 again.

Next.

If you cannot destroy blocks, either you are holding a sword, or you are in Adventure Mode.

You can change back by executing the command (pre 1.13):

/gamemode 1

Edit: The new command post 1.13 is:

/gamemode creative