A wooden desk drawer with ball bearing drawer slides opens and closes very easily. If the desk is not level, or is slightly tilted, the drawer may open by itself and pushing it closed may only work temporarily.
A fix is to use a stick-on magnet between the drawer and the desk. The magnet you need will depend on how much holding power is required. If very little holding power is required, you could use a business card refrigerator magnet. Cut the magnet into half inch wide strips. Use double stick tape to attach one strip to the drawer and the other to the desk. Align the magnet strips so they are attracted to one another. A fail safe way to do this is to attach a magnet to the desk, put the drawer magnet on the desk magnet with the double stick tape facing out, then close the drawer firmly to attach the drawer magnet. Open the drawer and push firmly on each magnet for good adhesion.