A lot depends on the iOS your ipad runs, but here’s a few ideas:
The most common problem if your iPad is not sleeping properly is that it has not been inserted into its case correctly. The sleep / wake functionality works via a magnet inserted into the covers lid (front cover). If this doesn’t line up correctly with the magnetic sensor in the iPad then the function won’t work correctly.
Check this setting. Settings > General > iPad cover lock > Unlock ON. The Smart Cover is activated in the Settings App, General and in the right-hand panel under Lock/Unlock and slide the switch over showing a green activation color. From the Home screen tap ‘Settings’
This should automatically open up in the “General” options, but if not simply tap “General” in the left-hand side options. In the 4th block of General options you will see “iPad Cover Lock / Unlock” option. If this is set to “Off” it means that the Sleep / Wake function has been disabled. Simply slide this across into the “On” position to activate Press the Home button to return
If your smart case uses Bluetooth, go to Settings > Bluetooth and make sure BT is toggled ON. Once on, it shows the list of devices it’s already paired with.