How do I install the latest Magento 2 via composer with sample data and Elasticsearch?

Using Debian 10 ,i installed PHP 7.4, PHP-FPM 7.4 ,Mysql 8,NGINX,Elasticsearch, Magento2 via composer,Redis-Server,varnish,Changed the ownership of all files to a user,and run NGINX using this user,Configured PHPMyAdmin.Is any tutorial available to make the server works properly.