Gene selection is entirely on you and on the question you ask. Most expressed genes would be selected by
rowMedians or even
rowSums but this is not very informative as digital expression levels (=counts) is influenced by many technical factors and there is (to my knowledge) no direct link to biological relevance.
Alternatively, you can select by genes that vary a lot between experimental groups. Naively that could be the rowwise variance (
rowVars) or standard deviation of the logCPMs (use logscale, otherwise variance is a function of the expression level) or the output of a differential analysis. Ideally plug the raw counts into DESeq2 or similar frameworks. If you only have CPMs then you probably want to feed the logCPMs into limma-trend pipeline, see for a discussion on ways to get going with normalized counts for differential expression in this Bioconductor thread.
Visualization is then again on you. Either make a heatmap (see for example ComplexHeatmap package) or aggregate the genes into a PCA (see for example PCAtools package at Bioconductor), all mentioned packages contain extensive example code and background information which is fully sufficient to run such an analysis.