A package name alone says little. Before you install something unfamiliar, apt show tells you what it is, how big it is and where it comes from.
Give it one or more package names:
apt show nginx
apt show -a nginx
The output has the version, the section, the maintainer, the installed size, the download size, the dependencies, a homepage and the full description. For a package you already have, it also shows APT-Manual-Installed: yes or no, which tells you whether you asked for it or it came along as a dependency, and APT-Sources, the repository it comes from.
By default you get the candidate version, the one apt would install. -a shows every version that your repositories offer, one block each, which is handy when a PPA or a backports repository has a newer one.
I’d look at three fields. Depends and Recommends show what else will come along, and Installed-Size keeps you from pulling 500 MB of desktop libraries onto a small server by accident.
The apt command prints a warning that its output isn’t stable for scripts. For a script, use apt-cache show, which prints the same kind of record without that warning. And it only knows what your package lists know, so run sudo apt update first if the lists are old.
Further reading: apt(8) manual page, apt-cache(8) manual page