Both will work just fine. One time, I cooked pinto beans for 24 hours in a slow cooker and they were extra delicious. With a slow cooker, follow the instructions but cook the pinto beans at a high temperature for 3-4 hours. When using an Instant Pot, follow the cooking instructions, but include  8-10 minutes on high pressure (or 25-30 minutes for unsoaked beans) then let the pressure release naturally.