Every time I press F3 it changes my volume instead of opening the debug overlay. Is there a way I can fix this in settings?
I use the latest version of Minecraft.
If you are playing on a laptop, see if you have a "Fn" key on the keyboard. Mostly likely what has happened is that your computer is configured to require the Fn (function) key to be pressed in order to send F1-F12 keystrokes, instead of the "media" keys like volume up, volume down, screen brightness, etc. This can usually be changed in the BIOS or in Windows itself, depending on the configuration. This is what the Fn key may look like:
If that doesn't fix your issue, then check Minecraft keymaps and keymappings in Windows and/or your computer's BIOS to see if they can be toggled or changed.
I had the same issue on my HP laptop. I had to boot up the computer, pressing the appropriate key during boot (I had to look up the laptop model online to figure it out) to get me into the BIOS menu system, then I had to poke around to figure out how to change the default meaning of the function keys from being "media" keys to being "function" keys. This isn't particularly difficult, just time-consuming and frustrating. An F-lock key as described by @Grant would have made this much simpler. Are you listening, HP? (Probably not. The HP of today seems more interested in repeating their past mistakes (HP cell phone, anyone?) instead of doing what they do well - which since the days of Carly Fiorina, the Compaq takeover, and the departure from the test equipment business seems to be "nothing").