An uptrend prints higher-highs-higher-lows; a downtrend prints lower highs and lower lows; a range does neither. Trend depends entirely on the timeframe. A stock can be in a daily uptrend and a 5-minute downtrend at the same moment.
Trading with the trend does not guarantee anything, but entering a pullback in the direction of the higher-timeframe trend is the most common framework in swing-trading.
Example: a stock's daily lows over six weeks are $40, $43, $46, $49. Each low is higher than the last. That is an uptrend regardless of what the last hour looks like.
Related: higher-highs-higher-lows, range, pullback, timeframe, moving-average