Based on that post... you have a long way to go my friend! But it is easy once you get started.
You can plumb it whatever way you like. With 40 g you can use basically any size diameter plumbing, hard or soft, just don't use clear or it will grow algae in there.
You need to think about your drain system. Herbie, Durso or Bean animal. Familiarize yourself with those systems.
Then you'll need to think about how you'll get the water back to the tank. We would call that your return. You'll also need to think about what you want in the sump at this point also.
There is no one way that is perfect for sump design. You can get to a good place using any, all, or a variety of any of the concepts and designs. Whichever works best for your location and tank size is fine.
*If your building your sump (if it was me) for a 40g, I would use a 20g long tank for the sump. Probably