How to return pid of a last command in Linux / Unix

Originally published at: https://www.cyberciti.biz/faq/how-to-return-pid-of-a-last-command-in-linux-unix/

I need to find and return the PID of the last command executed in Linux. How do I return the PID of command in Linux?