The number buttons on the top of the keyboard are used to toggle collections on and off, this can be a pain, and is throwback to Blenders old layer system. I have reassigned these to select the different modes.
If you go into preferences, select 'keymap' and search for collection, you will find the visibility settings for the first 10 collections. Disable all these associations by clicking on the cross next to the entry, be careful, however, you can undo these changes by clicking the restore button at any time. Now you have freed up the row of number buttons ,so you can now set whatever you want to them. Click on 'Object Mode'(if that is the mode you are currently in), hover over the mode you want, Rt click and press the key you want to associate with that mode. Do this for all modes. Now you can quickly enter the mode you want with a single button push. Just remember in edit mode buttons 1,2 & 3 are used for different selection types, so from edit you will have the return to object mode using TAB. But the rest work fine and it is a lot easier than searching around the pie menu. If you are happy with the settings, you can save them in preferences, by clicking 'Save Preferences *'. The star symbol means that changes have not been saved. If you do not save the changes you made the old settings will be restored when you restart Blender.