How can I use a Gurumukhi font to typeset Punjabi with XeLaTeX or PDFLatex?

Here is a possible solution using the Saab font. I don't know anything about the Gurmukhi script, and the Saab font doesn't seem to recognize the Gurmukhi script tag, even though it should, so there may be problems with the font. For small sections of Punjabi text, this may be sufficient. For whole documents you would need to write your own version of a polyglossia .ldf file for Punjabi, but this is not really a beginner's task, unfortunately.

(If there are major problems with the output of this, (apart from the bad Google translation) please let me know in the comments and I will delete the answer.)

% !TEX TS-program = XeLaTeX

\documentclass[10pt]{article}
\usepackage{fontspec}
\newfontfamily\punjabifont{Saab}
\DeclareTextFontCommand{\textpunjabi}{\punjabifont}

\begin{document}
\section{A section}
\textpunjabi{ ਇਹ ਇੱਕ ਦੀ ਸਜ਼ਾ ਜੋ ਕਿ ਹੈ ਬੁਰੀ} Google \textpunjabi{ਦੁਆਰਾ ਅਨੁਵਾਦ ਕੀਤਾ ਗਿਆ ਹੈ.}
\end{document}

output of code