A 30A-capable generator that only produces 120V is (a) relatively unusual (in fact, more likely can't actually generate close to 30A) (except I just found there are quite a few designed with "RV outlet") and (b) extremely limited as it can't power any 240V loads and can only power half of your 120V loads unless you bridge it to both hots (and then you run into potential MWBC neutral issues). I highly recommend looking into generators that can produce more power with a 240V 30A output.
There are two absolutely key issues here and one secondary issue:
Inlet vs. Outlet
An ordinary receptacle has holes or slots in it for prongs from a plug. That is an outlet. It is use for sending power out of the receptacle. When you are sending power in to a receptacle then it must be the opposite, an inlet with prongs on it, which is used with a plug that has matching holes or slots in it. Here is a 30A example, Leviton brand, from Amazon:

Note that you can use an ordinary extension cord (as long as it is sized appropriately for the particular circuit type) because the male end will go into the outlet on the generator and the female end will go into the inlet on your house.
For safety (especially carbon monoxide concerns) the inlet should be mounted on the outside of your house or garage, not inside, as that will help make sure you actually run the generator outside.
Generator Interlock
An interlock is a device, typically a couple pieces of specially designed metal that only allow one of a pair of breakers to be on at a time. This is required (unless you have an automatic transfer switch which would include an equivalent automatic mechanism) to use a generator in place of utility power because otherwise someone will go through the sequence of steps incorrectly (stuff happens, particularly when there are storms going on and/or people are worried about getting the power on to keep refrigerators and/or HVAC running) and potentially zap a utility worker.
Correction: If your generator inlet is connected through a subpanel then the subpanel feed must have an interlock in the main panel. Which effectively means the only loads that could be on the subpanel would be loads powered only when on generator power. Which basically makes the subpanel useless in most circumstances. Which means running a fresh 10 AWG cable (in which case I recommend /3 for future expansion to 240V even though /2 will do for 120V) or 10 AWG wires in conduit from the main panel to wherever the inlet is installed (i.e., even if the inlet will be near an existing subpanel).
Ground/Neutral
Based on the description, it sounds like you have a single bar for neutral ("common") and ground in the subpanel. That is not allowed any more. This is an important issue in general, independent of the generator installation.
If the subpanel is very old and there is no separate ground wire (or metal conduit as ground) between the main panel and subpanel and that was legitimate at the time the subpanel was installed then that is OK. Otherwise, you need to separate ground and neutral in the subpanel by installing a separate ground bar (if there isn't one already installed), removing the neutral/ground bond (if there is one) and moving wires as needed so that neutral wires are only on the neutral bar and ground wires are only on the ground bar.